[Bug c++/105350] New: False constructor warning in case of [[depreacated]] field in class
fchelnokov at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Apr 22 19:16:25 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105350
Bug ID: 105350
Summary: False constructor warning in case of [[depreacated]]
field in class
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: fchelnokov at gmail dot com
Target Milestone: ---
In the following code the field (a) must not be initialized in the default
constructor of A:
```
struct A {
[[deprecated]] int a;
A() noexcept {}
};
```
but GCC prints the warning:
```
'A::a' is deprecated [-Wdeprecated-declarations]
```
Clang does not complain. Demo: https://gcc.godbolt.org/z/9s5dEr6jf
More information about the Gcc-bugs
mailing list