summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-07-05 16:13:20 +0000
committerDouglas Gregor <dgregor@apple.com>2011-07-05 16:13:20 +0000
commit1fe12c9ebae193bcebc995cb2f9d2d08f745f89b (patch)
tree30496795c21740fd5c4087dceaee4d4a1790bb9e /clang/lib/Sema/SemaDeclCXX.cpp
parentea53901dc974aaa7a62b8be73fbefb38878d16b3 (diff)
downloadbcm5719-llvm-1fe12c9ebae193bcebc995cb2f9d2d08f745f89b.tar.gz
bcm5719-llvm-1fe12c9ebae193bcebc995cb2f9d2d08f745f89b.zip
ActOnCXXConditionDeclaration should take into account that
ActOnDeclarator can return NULL. Fixes PR10270, from Hans Wennborg! llvm-svn: 134416
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index ac51138b91d..368fd9259e3 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -8914,10 +8914,13 @@ DeclResult Sema::ActOnCXXConditionDeclaration(Scope *S, Declarator &D) {
"Parser allowed 'typedef' as storage class of condition decl.");
Decl *Dcl = ActOnDeclarator(S, D);
+ if (!Dcl)
+ return true;
+
if (isa<FunctionDecl>(Dcl)) { // The declarator shall not specify a function.
Diag(Dcl->getLocation(), diag::err_invalid_use_of_function_type)
<< D.getSourceRange();
- return DeclResult();
+ return true;
}
return Dcl;
OpenPOWER on IntegriCloud