summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-08-31 23:23:25 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-08-31 23:23:25 +0000
commite4caa48dbb744fb809db1f6f09de2ed9576efcea (patch)
tree505582594879dcd41b23047a8bfffcff116dbd15 /clang/lib/Sema/SemaTemplate.cpp
parent77807637ffb0fffd6f215187258b0e12c6b6a620 (diff)
downloadbcm5719-llvm-e4caa48dbb744fb809db1f6f09de2ed9576efcea.tar.gz
bcm5719-llvm-e4caa48dbb744fb809db1f6f09de2ed9576efcea.zip
DR259: Demote the pedantic error for an explicit instantiation after an
explicit specialization to a warning for C++98 mode (this is a defect report resolution, so per our informal policy it should apply in C++98), and turn the warning on by default for C++11 and later. In all cases where it fires, the right thing to do is to remove the pointless explicit instantiation. llvm-svn: 280308
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index ab5f545181b..7d573293f4e 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -6821,13 +6821,7 @@ Sema::CheckSpecializationInstantiationRedecl(SourceLocation NewLoc,
// instantiation of a template appears after a declaration of
// an explicit specialization for that template, the explicit
// instantiation has no effect.
- //
- // In C++98/03 mode, we only give an extension warning here, because it
- // is not harmful to try to explicitly instantiate something that
- // has been explicitly specialized.
- Diag(NewLoc, getLangOpts().CPlusPlus11 ?
- diag::warn_cxx98_compat_explicit_instantiation_after_specialization :
- diag::ext_explicit_instantiation_after_specialization)
+ Diag(NewLoc, diag::warn_explicit_instantiation_after_specialization)
<< PrevDecl;
Diag(PrevDecl->getLocation(),
diag::note_previous_template_specialization);
OpenPOWER on IntegriCloud