public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/53184] Unnecessary anonymous namespace warnings
Date: Mon, 17 Jun 2013 12:41:00 -0000	[thread overview]
Message-ID: <bug-53184-4-qYCK00FXGh@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53184-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53184

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I've just come across a case where an option to disable that warning would be
handy: We have a foo.cc file defining some classes in an anon namespace. A unit
test does #include "foo.cc" so it can test the implementation details, which
makes GCC (quite rightly) think it's a header file. In this case no other
translation unit is going to include the "header" and so there will be no ODR
violation, but we can't disable the warning so have to resort to macros to give
the namespace a name when used in this way, which means the test isn't testing
the real code.


  parent reply	other threads:[~2013-06-17 12:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02  6:09 [Bug c++/53184] New: " orgads at gmail dot com
2012-05-02  6:26 ` [Bug c++/53184] " pinskia at gcc dot gnu.org
2012-05-02  6:56 ` orgads at gmail dot com
2012-05-02 10:48 ` redi at gcc dot gnu.org
2012-05-02 17:23 ` jason at gcc dot gnu.org
2013-06-15 18:16 ` paolo.carlini at oracle dot com
2013-06-16  2:59 ` zeratul976 at hotmail dot com
2013-06-17 12:41 ` redi at gcc dot gnu.org [this message]
2013-06-17 12:43 ` paolo.carlini at oracle dot com
2013-06-17 12:58 ` paolo.carlini at oracle dot com
2015-04-27 19:45 ` paolo.carlini at oracle dot com
2015-08-19 14:44 ` paolo.carlini at oracle dot com
2015-09-09 16:48 ` paolo at gcc dot gnu.org
2015-09-09 16:53 ` paolo.carlini at oracle dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-53184-4-qYCK00FXGh@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).