ProcessDeclAttributes(NewFD, D);
if (getLangOptions().CPlusPlus) {
- // In C++, check default arguments now that we have merged decls.
- CheckCXXDefaultArguments(NewFD);
+ // In C++, check default arguments now that we have merged decls. Unless
+ // the lexical context is the class, because in this case this is done
+ // during delayed parsing anyway.
+ if (!CurContext->isRecord())
+ CheckCXXDefaultArguments(NewFD);
// An out-of-line member function declaration must also be a
// definition (C++ [dcl.meaning]p1).
// RUN: clang -fsyntax-only -verify %s
-// XFAIL
-// fails due to exact diagnostic matching
void f(int i, int j, int k = 3);
void f(int i, int j, int k);
// constructors.
class Z {
public:
- Z(Z&, int i = 17); // expected-note{{candidate function}}
+ Z(Z&, int i = 17); // expected-note 2 {{candidate function}}
void f(Z& z) {
Z z2; // expected-error{{no matching constructor for initialization}}