aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-25 08:28:21 +0000
committerChris Lattner <sabre@nondot.org>2009-04-25 08:28:21 +0000
commit6540180c2fd7a5b4963b22dc81461b73927499a8 (patch)
treeed53fd064c1b112bf8ee7fc972301e631b53b39f /lib/Sema/SemaDecl.cpp
parenteaaebc7cf10dc1a2016183a262ad3256bc468759 (diff)
various "is invalid" cleanups for C++ ctors/dtors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70021 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 64c85a2aad..9710bd95df 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1993,8 +1993,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
assert(DC->isRecord() &&
"Constructors can only be declared in a member context");
- if (!D.isInvalidType())
- D.setInvalidType(CheckConstructorDeclarator(D, R, SC));
+ R = CheckConstructorDeclarator(D, R, SC);
// Create the new declaration
NewFD = CXXConstructorDecl::Create(Context,
@@ -2005,8 +2004,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
} else if (D.getKind() == Declarator::DK_Destructor) {
// This is a C++ destructor declaration.
if (DC->isRecord()) {
- if (!D.isInvalidType())
- D.setInvalidType(CheckDestructorDeclarator(D, R, SC));
+ R = CheckDestructorDeclarator(D, SC);
NewFD = CXXDestructorDecl::Create(Context,
cast<CXXRecordDecl>(DC),