summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorVassil Vassilev <v.g.vassilev@gmail.com>2016-10-19 11:19:30 +0000
committerVassil Vassilev <v.g.vassilev@gmail.com>2016-10-19 11:19:30 +0000
commitc774a23bd9b704d0c114378be0cd3a262e5628ce (patch)
tree0f4c47996b40abef13573d4f7d1de6123b7463f6 /clang/lib/Sema/SemaDecl.cpp
parent9122ac994b5e69202b294238540f6847512f4824 (diff)
downloadbcm5719-llvm-c774a23bd9b704d0c114378be0cd3a262e5628ce.tar.gz
bcm5719-llvm-c774a23bd9b704d0c114378be0cd3a262e5628ce.zip
[modules] Do not report missing definitions of demoted constexpr variable templates.
This is a followup to regression introduced in r284284. This should fix our libstdc++ modules builds. https://reviews.llvm.org/D25678 Reviewed by Richard Smith! llvm-svn: 284577
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index af1ac443bae..b483690a03c 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -10124,7 +10124,11 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl,
// C++11 [dcl.constexpr]p1: The constexpr specifier shall be applied only to
// the definition of a variable [...] or the declaration of a static data
// member.
- if (Var->isConstexpr() && !Var->isThisDeclarationADefinition()) {
+ if (Var->isConstexpr() && !Var->isThisDeclarationADefinition() &&
+ !Var->isThisDeclarationADemotedDefinition()) {
+ assert((!Var->isThisDeclarationADemotedDefinition() ||
+ getLangOpts().Modules) &&
+ "Demoting decls is only in the contest of modules!");
if (Var->isStaticDataMember()) {
// C++1z removes the relevant rule; the in-class declaration is always
// a definition there.
OpenPOWER on IntegriCloud