diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-10-14 20:14:33 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-10-14 20:14:33 +0000 |
commit | 663b5a0be7261c29bc4c526a71cffcfa02d4153e (patch) | |
tree | 06582f834e2df99344af84881c6e6703502d84e2 /lib/Sema/SemaTemplate.cpp | |
parent | 54150d9b1d308334d40864c8d8d8d6d1a9da363e (diff) |
Testing and some minor fixes for explicit template instantiation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84129 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index d56b4e114e..457b219bb0 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/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 |