From 18eb69af7938137f5536d8d7cd5ef42d0397d8c5 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Mon, 22 Jun 2009 20:37:23 +0000 Subject: Changes made per Doug's comments. llvm-svn: 73897 --- clang/lib/Sema/SemaExpr.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'clang/lib/Sema/SemaExpr.cpp') diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index e989b1f282f..d0cd23e8592 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -5462,9 +5462,13 @@ void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) { // Note that this declaration has been used. if (CXXConstructorDecl *Constructor = dyn_cast(D)) { - DefineImplicitDefaultConstructor(Loc, Constructor); - // FIXME: set the Used flag if it is determined that ctor is valid. - Constructor->setUsed(true); + if (Constructor->isImplicit() && Constructor->isDefaultConstructor()) { + if (!Constructor->isUsed()) + DefineImplicitDefaultConstructor(Loc, Constructor); + } + // FIXME: more checking for other implicits go here. + else + Constructor->setUsed(true); return; } -- cgit v1.2.3