Issue 163683
Summary Spurious warning in C++11 when attempting to define a constexpr destructor
Labels clang:diagnostics
Assignees
Reporter shafik
    In C++11 we are not allowed to declare/define a `constexpr` destructor, we obtain the proper diagnostic for this in clang but if we attempt to also define is then clang provides a completely spurious diagnostic as well: https://godbolt.org/z/Geq7Th7oh

```cpp
struct A {
  constexpr ~A(){}
};
```

Diagnostic:

```console
<source>:2:3: error: destructor cannot be declared constexpr
    2 |   constexpr ~A(){}
      | ^
<source>:2:13: error: constexpr function's return type 'void' is not a literal type
    2 |   constexpr ~A(){}
      |             ^
```

The second diagnostic is just not helpful at all.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to