[Bug c++/59480] New: Missing error diagnostic: friend declaration specifying a default argument must be a definition
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Dec 12 08:36:00 GMT 2013
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."
More information about the Gcc-bugs
mailing list