public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105350] New: False constructor warning in case of [[depreacated]] field in class
@ 2022-04-22 19:16 fchelnokov at gmail dot com
  0 siblings, 0 replies; only message in thread
From: fchelnokov at gmail dot com @ 2022-04-22 19:16 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-22 19:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-22 19:16 [Bug c++/105350] New: False constructor warning in case of [[depreacated]] field in class fchelnokov at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).