summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseTemplate.cpp
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2011-10-13 22:18:05 +0000
committerJeffrey Yasskin <jyasskin@google.com>2011-10-13 22:18:05 +0000
commita722170eb95ddbf6b1223b6739b93058d996e05d (patch)
tree6ebaf58f58567d34018450bb0b5832186e982b1a /clang/lib/Parse/ParseTemplate.cpp
parent51862b3890db908a624f6bc8b7203a9a31477930 (diff)
downloadbcm5719-llvm-a722170eb95ddbf6b1223b6739b93058d996e05d.tar.gz
bcm5719-llvm-a722170eb95ddbf6b1223b6739b93058d996e05d.zip
Implement the first piece of a -Wc++98-compat flag so that people can build in
C++11 mode but keep their sources compatible with C++98. This patch implements the -Wc++98-compat-variadic-templates sub-flag and -Wc++98-compat to include it. llvm-svn: 141898
Diffstat (limited to 'clang/lib/Parse/ParseTemplate.cpp')
-rw-r--r--clang/lib/Parse/ParseTemplate.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp
index 92fe4a5f335..3d68a4ab9db 100644
--- a/clang/lib/Parse/ParseTemplate.cpp
+++ b/clang/lib/Parse/ParseTemplate.cpp
@@ -475,8 +475,10 @@ Decl *Parser::ParseTypeParameter(unsigned Depth, unsigned Position) {
Ellipsis = true;
EllipsisLoc = ConsumeToken();
- if (!getLang().CPlusPlus0x)
- Diag(EllipsisLoc, diag::ext_variadic_templates);
+ Diag(EllipsisLoc,
+ getLang().CPlusPlus0x
+ ? diag::warn_cxx98_compat_variadic_templates
+ : diag::ext_variadic_templates);
}
// Grab the template parameter name (if given)
@@ -547,8 +549,10 @@ Parser::ParseTemplateTemplateParameter(unsigned Depth, unsigned Position) {
if (Tok.is(tok::ellipsis)) {
EllipsisLoc = ConsumeToken();
- if (!getLang().CPlusPlus0x)
- Diag(EllipsisLoc, diag::ext_variadic_templates);
+ Diag(EllipsisLoc,
+ getLang().CPlusPlus0x
+ ? diag::warn_cxx98_compat_variadic_templates
+ : diag::ext_variadic_templates);
}
// Get the identifier, if given.
OpenPOWER on IntegriCloud