This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/86502] New: friend declaration specifying a default argument must be a definition


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

            Bug ID: 86502
           Summary: friend declaration specifying a default argument must
                    be a definition
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhonghao at pku dot org.cn
  Target Milestone: ---

The code is as follow:

class Test
{
 friend const int getInt(int inInt = 0);
};


g++ accepts it, but clang++ rejects it:

error: friend declaration specifying a default argument must be a definition

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]