This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61470] New: ill-formed friend declaration(s) with default-arguments not caught
- From: "filip.roseen at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 11 Jun 2014 10:39:40 +0000
- Subject: [Bug c++/61470] New: ill-formed friend declaration(s) with default-arguments not caught
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61470
Bug ID: 61470
Summary: ill-formed friend declaration(s) with
default-arguments not caught
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: filip.roseen at gmail dot com
Created attachment 32920
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32920&action=edit
testcase.cpp
struct A {
friend void f(int=0); // (A), ill-formed, [dcl.fct.default]p4
friend void g(int=0){}; // ( ), legal
};
void g(int); // (B), ill-formed, [dcl.fct.default]p4
int main () { }
---------------------
(A) and (B) are violating the following sentence from [dcl.fct.default]p4:
> 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.