[clang] [clang] Support `__is_trivially_copyable(int()&)==false` (PR #81298)

via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 27 13:30:44 PDT 2024


fahadnayyar wrote:

Hey folks,

Because of this change the error message for certain type traits changed.
For example:
```
void f(void) {
  __has_nothrow_copy();
}
```
Earlier the error message was:  `expected a type`
New error message is: `type name requires a specifier or qualifier`

Ref: https://godbolt.org/z/d4884bYz3

I personally feel the previous error made more sense for this case as the type name is missing in the type trait call. If the type name  is present but the qualifier or specifier are not present then only the new message makes sense.

What do you think, is it a regression or correct behaviour?
@AMP999 @cor3ntin @AaronBallman 

https://github.com/llvm/llvm-project/pull/81298


More information about the cfe-commits mailing list