summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-10-14 20:14:33 +0000
committerDouglas Gregor <dgregor@apple.com>2009-10-14 20:14:33 +0000
commit3c74d41d27114459ae38edb7b19a9eb6f19285cf (patch)
tree2917a4278853d07377d9d7799704cb2366fc06c6 /clang/lib/Sema/SemaTemplate.cpp
parenta39f12115583f61ff04469a507d268685a2d679a (diff)
downloadbcm5719-llvm-3c74d41d27114459ae38edb7b19a9eb6f19285cf.tar.gz
bcm5719-llvm-3c74d41d27114459ae38edb7b19a9eb6f19285cf.zip
Testing and some minor fixes for explicit template instantiation.
llvm-svn: 84129
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index d56b4e114e7..457b219bb06 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -3647,6 +3647,19 @@ Sema::DeclResult Sema::ActOnExplicitInstantiation(Scope *S,
return true;
}
+ // C++0x [temp.explicit]p1:
+ // [...] An explicit instantiation of a function template shall not use the
+ // inline or constexpr specifiers.
+ // Presumably, this also applies to member functions of class templates as
+ // well.
+ if (D.getDeclSpec().isInlineSpecified() && getLangOptions().CPlusPlus0x)
+ Diag(D.getDeclSpec().getInlineSpecLoc(),
+ diag::err_explicit_instantiation_inline)
+ << CodeModificationHint::CreateRemoval(
+ SourceRange(D.getDeclSpec().getInlineSpecLoc()));
+
+ // FIXME: check for constexpr specifier.
+
// Determine what kind of explicit instantiation we have.
TemplateSpecializationKind TSK
= ExternLoc.isInvalid()? TSK_ExplicitInstantiationDefinition
OpenPOWER on IntegriCloud