12 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3class test1 {4 template <typename> friend int bar(bool = true) {} // expected-note {{previous declaration is here}}5 template <typename> friend int bar(bool); // expected-error {{friend declaration specifying a default argument must be the only declaration}}6};7 8class test2 {9 friend int bar(bool = true) {} // expected-note {{previous declaration is here}}10 friend int bar(bool); // expected-error{{friend declaration specifying a default argument must be the only declaration}}11};12