[PATCH] D135177: [clang] adds `__is_scoped_enum`, `__is_nullptr`, and `__is_referenceable`

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 11:38:10 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/test/SemaCXX/type-traits.cpp:374
 
+void is_scoped_enum() {
+  static_assert(!__is_scoped_enum(Enum), "");
----------------
It'd probably not be a bad idea at some point to add test coverage for incomplete types.


================
Comment at: clang/test/SemaCXX/type-traits.cpp:822
+
+  { int a[F(__is_referenceable(void))]; }
+}
----------------
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));
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135177/new/

https://reviews.llvm.org/D135177



More information about the cfe-commits mailing list