aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2008-09-01 18:42:41 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2008-09-01 18:42:41 +0000
commit73419bf6cbf8e5f7a0f9b8855d6531db264ae899 (patch)
tree31d44adec5174d5d680f0eeddd981ae210c8898c /lib/Sema/SemaDecl.cpp
parentf7e37ce8400d5ba3b0613116034aaa30e6a70b3e (diff)
fix one more this-is-not-a-constant error. test included
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55609 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index bf7c690ac2..d93a5eca5f 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1269,6 +1269,9 @@ bool Sema::CheckForConstantInitializer(Expr *Init, QualType DclT) {
if (Init->getType()->isArrayType())
return false;
+ if (Init->getType()->isFunctionType())
+ return false;
+
Diag(Init->getExprLoc(), diag::err_init_element_not_constant,
Init->getSourceRange());
return true;