aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-02-08 14:56:26 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-02-08 14:56:26 +0000
commit00d50747e8442a4d0daf2dfc226aec354fd3441e (patch)
tree327d3b624fd438a76d153cad303a356b1bc0704c /lib/Sema/SemaDecl.cpp
parent89ef6e03665635d965ba6c92035a85b125e6c78c (diff)
Fix redundant errors with missing default arguments in member declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64085 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index f5681af0fa..c0160b2d42 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1707,8 +1707,11 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
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).