aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-10-14 19:58:02 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-10-14 19:58:02 +0000
commitfe6f64846b8714b2951d9ea80fc40a3e020f3920 (patch)
tree18e2d52925ea6aeb7b1990951ea3b0192f64fac2 /lib/Sema/SemaTemplate.cpp
parentf886d6f5ec01e521afc39e967f9ff614c4e1c8e7 (diff)
[temp.explicit]p1: constexpr cannot be specified in explicit instantiations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141982 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 929d74efa9..8dda34c8ab 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -6164,9 +6164,12 @@ DeclResult Sema::ActOnExplicitInstantiation(Scope *S,
if (D.getDeclSpec().isInlineSpecified() && getLangOptions().CPlusPlus0x)
Diag(D.getDeclSpec().getInlineSpecLoc(),
diag::err_explicit_instantiation_inline)
- <<FixItHint::CreateRemoval(D.getDeclSpec().getInlineSpecLoc());
-
- // FIXME: check for constexpr specifier.
+ << FixItHint::CreateRemoval(D.getDeclSpec().getInlineSpecLoc());
+ if (D.getDeclSpec().isConstexprSpecified())
+ // FIXME: Add a fix-it to remove the 'constexpr' and add a 'const' if one is
+ // not already specified.
+ Diag(D.getDeclSpec().getConstexprSpecLoc(),
+ diag::err_explicit_instantiation_constexpr);
// C++0x [temp.explicit]p2:
// There are two forms of explicit instantiation: an explicit instantiation