Issue 110224
Summary clang-19 unconditionally sets `__cpp_deleted_function`
Labels new issue
Assignees
Reporter mpusz
    `__cpp_deleted_function` should be set only for C++26 and higher. It is set even for C++20 now (https://godbolt.org/z/T7Ph3E4fz), which makes the following code:

```cpp
  [[nodiscard]] friend consteval Unit auto operator*(Unit auto, Magnitude auto)
#if __cpp_deleted_function
    = delete("To scale a unit use `mag * unit` syntax");
#else
    = delete;
#endif
```

result in the following error on C++20 build:

```text
unit.h:154:14: error: '= delete' with a message is a C++2c extension [-Werror,-Wc++26-extensions]
   154 |     = delete("To scale a unit use `mag * unit` syntax");
       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to