public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59480] New: Missing error diagnostic: friend declaration specifying a default argument must be a definition
@ 2013-12-12  8:36 burnus at gcc dot gnu.org
  2013-12-12  8:40 ` [Bug c++/59480] " burnus at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-12-12  8:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59480
           Summary: Missing error diagnostic: friend declaration
                    specifying a default argument must be a definition
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org

The following code compiles with GCC with "g++ -Wall -Werror -std=c++11
-pedantic":

class test {
  friend int bar(int = true);
};

However, with Clang++ it is rejected with:
  error: friend declaration specifying a default argument must be a definition


In N3337, one finds at the end of the paragraph 8.3.6.4 [dcl.fct.default]: "If
a friend declaration specifies a default argument expression, that declaration
shall be a definition and shall be the only declaration of the function or
function template in the translation unit."


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

end of thread, other threads:[~2015-08-24 15:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-12  8:36 [Bug c++/59480] New: Missing error diagnostic: friend declaration specifying a default argument must be a definition burnus at gcc dot gnu.org
2013-12-12  8:40 ` [Bug c++/59480] " burnus at gcc dot gnu.org
2014-06-26 17:19 ` paolo.carlini at oracle dot com
2014-12-14  1:05 ` ville.voutilainen at gmail dot com
2015-08-24 14:43 ` manu at gcc dot gnu.org
2015-08-24 15:02 ` redi at gcc dot gnu.org
2015-08-24 15:31 ` manu 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).