Issue 152018
Summary Clang accepts invalid parenthesized constructor declarator
Labels
Assignees
Reporter zygoloid
    Per [[class.ctor.general]/1](https://eel.is/c++draft/class.ctor.general#1), a constructor declarator cannot be parenthesized:

```c++
struct A {
  // OK, constructor
  (A)(int);

  // Error, not a constructor due to enclosing parens.
  (A(float));
};
// OK, constructor
(A::A(int)) {}
// Error, not a constructor due to enclosing parens.
(A::A(float)) {}
```

But Clang accepts anyway, as do all other major compilers. We should reject under `-pedantic-errors`, but given the widespread support it probably makes sense to continue to accept this by default.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to