Details
- Reviewers
aaron.ballman erichkeane - Group Reviewers
Restricted Project - Commits
- rGa089defa24dd: [clang] adds `__is_scoped_enum`, `__is_nullptr`, and `__is_referenceable`
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/test/SemaCXX/type-traits.cpp | ||
---|---|---|
405 | It'd probably not be a bad idea at some point to add test coverage for incomplete types. | |
830 | I think we should have test cases for the following: struct incomplete; __is_referenceable(struct incomplete); // Also interesting to make sure we handle elaborated type specifiers properly typedef void function_type(int); __is_referenceable(function_type); // Note, this is not a function *pointer* type struct S { void func1() &; void func2() const; }; // Both of these should be false, by my understanding of what "referenceable" means in the standard. __is_referenceable(decltype(&S::func1)); __is_referenceable(decltype(&S::func2)); |
Assuming the additional test cases don't uncover any surprises, this LGTM as well (modulo nits already brought up).
clang/include/clang/Basic/TokenKinds.def | ||
---|---|---|
525 | Shouldn't these traits be documented or is the documentation generated automatically from the def files? |
clang/test/SemaCXX/type-traits.cpp | ||
---|---|---|
830 | Do you have a test for: struct S { void func1() &; void func2() const; }; // Both of these should be false, by my understanding of what "referenceable" means in the standard. __is_referenceable(decltype(&S::func1)); __is_referenceable(decltype(&S::func2)); |
clang/lib/Parse/ParseExpr.cpp | ||
---|---|---|
1071 | Yeah, this feels like a commit split issue. Thanks for catching. | |
clang/test/SemaCXX/type-traits.cpp | ||
405 | I've added that coverage for __is_enum above too. | |
830 | I think the latter two are pointer-to-member functions, which are referenceable. We want to check void(int) const, which is done on the last green line of this file. |
LGTM
clang/test/SemaCXX/type-traits.cpp | ||
---|---|---|
830 | Ah thank you for showing me we already had the coverage! |
Shouldn't these traits be documented or is the documentation generated automatically from the def files?