public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61754] New: [C++1y] [[deprecated]] attribute warns annoyingly compared to __attribute__((deprecated))
@ 2014-07-08 18:11 daniel.kruegler at googlemail dot com
  2014-07-09 16:45 ` [Bug c++/61754] " emsr at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2014-07-08 18:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61754
           Summary: [C++1y] [[deprecated]] attribute warns annoyingly
                    compared to __attribute__((deprecated))
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: daniel.kruegler at googlemail dot com

The following code, compiled with 4.10.0 20140707 (experimental) using the
compiler settings:

-Wall -Wextra -std=c++1y -pedantic

//-----------------
struct __attribute__((deprecated)) Old1 {};

Old1 old1 __attribute__((deprecated));

struct [[deprecated]] Old2 {};

Old2 old2 [[deprecated]]; // ##

int main() {}
//-----------------

produces a warning on the line marked with ##:

"warning: 'Old2' is deprecated (declared at prog.cc:5)
[-Wdeprecated-declarations] 
 Old2 old2 [[deprecated]]; 
                        ^"

Note that the corresponding example using type Old1 does not so. Is the
difference in behaviour intended? I'm pretty sure that either variant is
conforming, but this has the effect that it makes [[deprecated]] much less
attractive in real-world code bases.

Please let me know whether the difference is due to your reading of the
standard, in this case I would like to submit a core language issue to make the
wording clearer for such situations.


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

end of thread, other threads:[~2023-05-04  3:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-08 18:11 [Bug c++/61754] New: [C++1y] [[deprecated]] attribute warns annoyingly compared to __attribute__((deprecated)) daniel.kruegler at googlemail dot com
2014-07-09 16:45 ` [Bug c++/61754] " emsr at gcc dot gnu.org
2014-12-08 17:47 ` ville.voutilainen at gmail dot com
2023-05-04  3:10 ` herring at lanl dot gov

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