[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
Mon Oct 10 06:06:37 PDT 2022
aaron.ballman added inline comments.
================
Comment at: clang/test/SemaCXX/type-traits.cpp:822
+
+ { int a[F(__is_referenceable(void))]; }
+}
----------------
aaron.ballman wrote:
> 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));
> ```
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));
```
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