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

zhonghao at pku dot org.cn gcc-bugzilla@gcc.gnu.org
Thu Jul 12 01:08:00 GMT 2018


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


More information about the Gcc-bugs mailing list