public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96078] New: [10/11 Regression] flatten attribute on constructor and destructor causes spurious warning
@ 2020-07-06 13:15 rs2740 at gmail dot com
  2020-07-06 13:35 ` [Bug c++/96078] " redi at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: rs2740 at gmail dot com @ 2020-07-06 13:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96078

            Bug ID: 96078
           Summary: [10/11 Regression] flatten attribute on constructor
                    and destructor causes spurious warning
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rs2740 at gmail dot com
  Target Milestone: ---

struct A {
    [[gnu::flatten]] A() {}
    [[gnu::flatten]] ~A() {}
};

A a;

Produces no warnings with GCC 9 but on GCC 10 and trunk warns:

<source>:3:22: warning: 'flatten' attribute is ignored on aliases
[-Wattributes]

    3 |     [[gnu::flatten]] ~A() {}

      |                      ^

<source>:2:22: warning: 'flatten' attribute is ignored on aliases
[-Wattributes]

    2 |     [[gnu::flatten]] A() {}

      |                      ^

The warning appears to be introduced by the fix to PR92372.

Marking `A` as `final` eliminates the warnings, as does giving it an virtual
base class. Presumably the issue is that in the problematic case one of the
complete/base object c/dtors was treated as an alias for the other?

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-03-11 10:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 13:15 [Bug c++/96078] New: [10/11 Regression] flatten attribute on constructor and destructor causes spurious warning rs2740 at gmail dot com
2020-07-06 13:35 ` [Bug c++/96078] " redi at gcc dot gnu.org
2020-07-06 15:31 ` rguenth at gcc dot gnu.org
2020-07-07  8:54 ` marxin at gcc dot gnu.org
2020-07-23  6:52 ` rguenth at gcc dot gnu.org
2020-10-12 12:49 ` rguenth at gcc dot gnu.org
2021-02-12  3:04 ` jason at gcc dot gnu.org
2021-02-12 17:10 ` jason at gcc dot gnu.org
2021-03-03  4:20 ` cvs-commit at gcc dot gnu.org
2021-03-03  4:22 ` [Bug c++/96078] [10 " jason at gcc dot gnu.org
2021-03-04  4:49 ` cvs-commit at gcc dot gnu.org
2021-03-04  4:52 ` jason at gcc dot gnu.org
2021-03-11 10:38 ` aoliva at gcc dot gnu.org

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).