-
Notifications
You must be signed in to change notification settings - Fork 11.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libcxx] improves diagnostics for containers with bad value types #106296
base: main
Are you sure you want to change the base?
Commits on Aug 27, 2024
-
[libcxx] improves diagnostics for containers with bad value types
`std::vector<int&>` generates nearly 170 lines of diagnostic, most of which are redundant, and it's only helpful if you are already familiar with the rule that containers can't hold reference types. This commit reduces it to only a handful of lines, all of which are dedicated to clearly communicating the problem. It also applies this to all the other containers, and for all non-cv-qualified and non-object types. These static_asserts are placed at the very top of each container because they short-circuit further instantiation errors, thereby leading a smaller set of diagnostics for the programmer. Placing them in `std::allocator` (which is the common denominator for all containers) doesn't do the short circuiting, and we thus end up with several unhelpful diagnostics after the helpful one. This commit only cleans up things that are already diagnosed as compile-time errors. In particular, `map<int&&, int>` should be ill-formed, per [associative.reqmts.general]/p8. libc++ and libstdc++ currently permit that, but not `map<int&, int>`. As such, this commit only adds a static assert for `map<K&, V>`, and defers diagnosing valid productions that should be ill-formed to a future commit.
Configuration menu - View commit details
-
Copy full SHA for 5529499 - Browse repository at this point
Copy the full SHA 5529499View commit details
Commits on Aug 29, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1e6b81b - Browse repository at this point
Copy the full SHA 1e6b81bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c1e1e3 - Browse repository at this point
Copy the full SHA 6c1e1e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 938299d - Browse repository at this point
Copy the full SHA 938299dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 65346a3 - Browse repository at this point
Copy the full SHA 65346a3View commit details -
more formatting, with a successful git clang-format
I think the best way to enact `git clang-format` might be to use `git clang-format <hash-before-your-commit-first>` instead of `git clang-format HEAD~n`. This ensures that all commits in a PR are formatted, instead of just the last n (which one might miscount, like I probably did).
Configuration menu - View commit details
-
Copy full SHA for 472ffcf - Browse repository at this point
Copy the full SHA 472ffcfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7596a2e - Browse repository at this point
Copy the full SHA 7596a2eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 25e999f - Browse repository at this point
Copy the full SHA 25e999fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5a1b902 - Browse repository at this point
Copy the full SHA 5a1b902View commit details -
Configuration menu - View commit details
-
Copy full SHA for 99a4509 - Browse repository at this point
Copy the full SHA 99a4509View commit details -
finally gets git-clang-format on side
The trick is to run ``` $ git-clang-format --diff <base-hash> --extensions ,cpp,h | patch -p1 ```
Configuration menu - View commit details
-
Copy full SHA for 45c85d6 - Browse repository at this point
Copy the full SHA 45c85d6View commit details
Commits on Sep 3, 2024
-
unifies the containers' diagnostics
A Clang pragma that lets us "hide" macro expansion from diagnostics so that users don't need to read implementation details would be a good thing to explore in the future.
Configuration menu - View commit details
-
Copy full SHA for dbf872a - Browse repository at this point
Copy the full SHA dbf872aView commit details -
Update libcxx/include/__type_traits/diagnostic_utilities.h
Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for e596964 - Browse repository at this point
Copy the full SHA e596964View commit details -
Configuration menu - View commit details
-
Copy full SHA for e2d65c0 - Browse repository at this point
Copy the full SHA e2d65c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0487281 - Browse repository at this point
Copy the full SHA 0487281View commit details -
changes using
is_array
tois_bounded_array
`std::llocator` apparently supports unbounded arrays prior to C++20, so we need to change the `is_array` check to only check for bounded arrays.
Configuration menu - View commit details
-
Copy full SHA for 6d9ce9e - Browse repository at this point
Copy the full SHA 6d9ce9eView commit details
Commits on Sep 6, 2024
-
reduces the number of trait instantiations
Nikolas pointed out that checking all the traits in all cases will probably grind builds to a halt as we improve our diagnostics, so this commit makes a point of reducing the number of instantiations as much as possible, and preserves the highly specific messages.
Configuration menu - View commit details
-
Copy full SHA for c49b7e8 - Browse repository at this point
Copy the full SHA c49b7e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for eb2fd68 - Browse repository at this point
Copy the full SHA eb2fd68View commit details -
Configuration menu - View commit details
-
Copy full SHA for 55a2e7a - Browse repository at this point
Copy the full SHA 55a2e7aView commit details -
Configuration menu - View commit details
-
Copy full SHA for d9043c4 - Browse repository at this point
Copy the full SHA d9043c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab41024 - Browse repository at this point
Copy the full SHA ab41024View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7bd03b3 - Browse repository at this point
Copy the full SHA 7bd03b3View commit details -
Configuration menu - View commit details
-
Copy full SHA for ef9d9c3 - Browse repository at this point
Copy the full SHA ef9d9c3View commit details
Commits on Sep 7, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f0f88d7 - Browse repository at this point
Copy the full SHA f0f88d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for bb82c95 - Browse repository at this point
Copy the full SHA bb82c95View commit details
Commits on Sep 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 33a452d - Browse repository at this point
Copy the full SHA 33a452dView commit details
Commits on Sep 9, 2024
-
Update libcxx/include/__type_traits/diagnostic_utilities.h
Co-authored-by: Nikolas Klauser <nikolasklauser@berlin.de>
Configuration menu - View commit details
-
Copy full SHA for 6981a2a - Browse repository at this point
Copy the full SHA 6981a2aView commit details -
Update libcxx/include/__type_traits/diagnostic_utilities.h
Co-authored-by: Nikolas Klauser <nikolasklauser@berlin.de>
Configuration menu - View commit details
-
Copy full SHA for 9fe3f4a - Browse repository at this point
Copy the full SHA 9fe3f4aView commit details
Commits on Sep 10, 2024
-
Configuration menu - View commit details
-
Copy full SHA for b97942e - Browse repository at this point
Copy the full SHA b97942eView commit details
Commits on Sep 11, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 02ffa16 - Browse repository at this point
Copy the full SHA 02ffa16View commit details
Commits on Sep 16, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f75d1ae - Browse repository at this point
Copy the full SHA f75d1aeView commit details