diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2011-10-13 22:18:05 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2011-10-13 22:18:05 +0000 |
commit | 48a9d189bbc989369155195a4ce8c7e1c02ea02a (patch) | |
tree | b0eb8817f0f2f5ec02bdf5f42c3daa5a85079b40 /lib/Parse/ParseTemplate.cpp | |
parent | 73fb35003aad027492e661a3749e921b5d1ecaf9 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141898 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseTemplate.cpp')
-rw-r--r-- | lib/Parse/ParseTemplate.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index 92fe4a5f33..3d68a4ab9d 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/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. |