Issue 109311
Summary Clang should not warn about =delete("reason") in C++17 mode while claiming to support it
Labels clang
Assignees
Reporter dangelog
    Clang 19 seems to define `__cpp_deleted_function` even in pre-C++26 modes. However using it results in a warning:

```
void f() = delete
#if __cpp_deleted_function >= 202403L
 ("reason")
#endif
;
```

```
<source>:3:6: warning: '= delete' with a message is a C++2c extension [-Wc++26-extensions]
    3 | ("reason")
      |      ^~~~~~~~
1 warning generated.
Compiler returned: 0
```

https://godbolt.org/z/Esqh5aPfb

It sounds a bit strange to claim support for a given language feature (by setting the corresponding feature-define macro), but then warn if that feature is used? Would it be possible, in pre-C++26 modes, to support the syntax and warn but _not_ set the macro?
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to