Parenthesized members are incorrectly recognized as constructors
Open
clang:frontend
confirmed
diverges-from:edg
diverges-from:gcc
diverges-from:msvc
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
The following program demonstrates the issue:
```cpp
struct S{
static S(foo);
};
int main(){}
```
`foo` isn't a valid _parameter-declaration-clause_, so this shouldn't be considered a constructor . GCC, MSVC, and EDG accept this. Clang correctly parses this with another set of parentheses, e.g. `static S((foo));`.
Contributor guide
Assessment
This issue has not been assessed yet.