aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-02-24 22:30:04 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-02-24 22:30:04 +0000
commitc7b5543ad32a5c265c02e71b2a6f9856440ed13f (patch)
treefd327493de2cb4ac67f606196476eff72d628aa0
parenta08c2fb74ef823c185619ecc532f8fced6a1982f (diff)
Back out __decltype warning from r151377: we should either warn on all the GNU
__keywords or none of them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151401 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/DiagnosticParseKinds.td3
-rw-r--r--lib/Parse/ParseDeclCXX.cpp4
-rw-r--r--test/SemaCXX/decltype-98.cpp4
3 files changed, 4 insertions, 7 deletions
diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td
index b3f2067ff6..95288acb86 100644
--- a/include/clang/Basic/DiagnosticParseKinds.td
+++ b/include/clang/Basic/DiagnosticParseKinds.td
@@ -254,9 +254,6 @@ def err_missing_comma_before_ellipsis : Error<
"C requires a comma prior to the ellipsis in a variadic function type">;
def err_unexpected_typedef_ident : Error<
"unexpected type name %0: expected identifier">;
-def ext_gnu_decltype : Extension<
- "'__decltype' type specifier is a GNU extension">,
- InGroup<GNU>, DefaultIgnore;
def warn_cxx98_compat_decltype : Warning<
"'decltype' type specifier is incompatible with C++98">,
InGroup<CXX98Compat>, DefaultIgnore;
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index 5468700bc9..d798281f40 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -653,8 +653,8 @@ SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) {
return EndLoc;
}
} else {
- Diag(Tok, Tok.getIdentifierInfo()->isStr("decltype")
- ? diag::warn_cxx98_compat_decltype : diag::ext_gnu_decltype);
+ if (Tok.getIdentifierInfo()->isStr("decltype"))
+ Diag(Tok, diag::warn_cxx98_compat_decltype);
ConsumeToken();
diff --git a/test/SemaCXX/decltype-98.cpp b/test/SemaCXX/decltype-98.cpp
index 44d5896c53..db52565e6c 100644
--- a/test/SemaCXX/decltype-98.cpp
+++ b/test/SemaCXX/decltype-98.cpp
@@ -1,3 +1,3 @@
-// RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify %s -Wgnu
+// RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify %s
extern int x;
-__decltype(1) x = 3; // expected-warning {{is a GNU extension}}
+__decltype(1) x = 3;