llvm-project/clang/test/SemaCXX/invalid-decl.cpp
Zahira Ammarguellat e562a40871 Fix for PR47544. Clang is crashing after generating the right
diagnostic for a re-declaration of a friend method.d
https://reviews.llvm.org/D88112
2020-10-27 05:57:39 -07:00

12 lines
551 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify %s
class test1 {
template <typename> friend int bar(bool = true) {} // expected-note {{previous declaration is here}}
template <typename> friend int bar(bool); // expected-error {{friend declaration specifying a default argument must be the only declaration}}
};
class test2 {
friend int bar(bool = true) {} // expected-note {{previous declaration is here}}
friend int bar(bool); // expected-error{{friend declaration specifying a default argument must be the only declaration}}
};