diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-02-05 06:12:42 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-02-05 06:12:42 +0000 |
commit | 1aa3edbb99852d587edf8b088fa7c7e9fb4da6d6 (patch) | |
tree | aeb17a8bd57f86aa5413ccb91353f515a141240d /clang/lib/Sema/SemaDecl.cpp | |
parent | 94e6d98caecc7e32eb5a31248631507fc6af6230 (diff) | |
download | bcm5719-llvm-1aa3edbb99852d587edf8b088fa7c7e9fb4da6d6.tar.gz bcm5719-llvm-1aa3edbb99852d587edf8b088fa7c7e9fb4da6d6.zip |
A function declarator with a non-identifier name in an anonymous class
is a constructor for that class, right? Fixes PR6238.
llvm-svn: 95367
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index bef53df4f0b..28f49d07986 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -2737,7 +2737,8 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, // (The parser checks for a return type and makes the declarator a // constructor if it has no return type). // must have an invalid constructor that has a return type - if (Name.getAsIdentifierInfo() == cast<CXXRecordDecl>(DC)->getIdentifier()){ + if (Name.getAsIdentifierInfo() && + Name.getAsIdentifierInfo() == cast<CXXRecordDecl>(DC)->getIdentifier()){ Diag(D.getIdentifierLoc(), diag::err_constructor_return_type) << SourceRange(D.getDeclSpec().getTypeSpecTypeLoc()) << SourceRange(D.getIdentifierLoc()); |