summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-06-06 01:34:24 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-06-06 01:34:24 +0000
commite883f1b319ed315f96652b3d0683e4b9ee137d91 (patch)
tree587c7769dfdf77a54a3593bffa1db10f7489be77 /lib/Sema/SemaDeclCXX.cpp
parent9a007fcb67ebc847266b84b9f5add2b16cfff22b (diff)
PR33318: Add missing full-expression checking to static_assert expression.
This fixes missing lambda-captures for variables referenced only inside a static_assert (!), among other things. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304760 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index acacdc263c..3e2306361c 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -13232,6 +13232,14 @@ Decl *Sema::BuildStaticAssertDeclaration(SourceLocation StaticAssertLoc,
}
}
+ ExprResult FullAssertExpr = ActOnFinishFullExpr(AssertExpr, StaticAssertLoc,
+ /*DiscardedValue*/false,
+ /*IsConstexpr*/true);
+ if (FullAssertExpr.isInvalid())
+ Failed = true;
+ else
+ AssertExpr = FullAssertExpr.get();
+
Decl *Decl = StaticAssertDecl::Create(Context, CurContext, StaticAssertLoc,
AssertExpr, AssertMessage, RParenLoc,
Failed);