r188840 - Remove Extension warning for GNU local labels.

Eli Friedman eli.friedman at gmail.com
Tue Aug 20 15:44:32 PDT 2013


Author: efriedma
Date: Tue Aug 20 17:44:32 2013
New Revision: 188840

URL: http://llvm.org/viewvc/llvm-project?rev=188840&view=rev
Log:
Remove Extension warning for GNU local labels.

We generally don't warn about extensions involving keywords reserved
for the implementation, so we shouldn't warn here either: the
standard doesn't require it, and it doesn't provide useful information
to the user.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticGroups.td
    cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
    cfe/trunk/lib/Parse/ParseStmt.cpp
    cfe/trunk/test/Sema/gnu-flags.c

Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=188840&r1=188839&r2=188840&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Tue Aug 20 17:44:32 2013
@@ -168,7 +168,6 @@ def : DiagGroup<"init-self">;
 def : DiagGroup<"inline">;
 def : DiagGroup<"invalid-pch">;
 def GNULabelsAsValue : DiagGroup<"gnu-label-as-value">;
-def GNULocalLabel : DiagGroup<"gnu-local-label">;
 def LiteralRange : DiagGroup<"literal-range">;
 def LocalTypeTemplateArgs : DiagGroup<"local-type-template-args",
                                       [CXX98CompatLocalTypeTemplateArgs]>;
@@ -540,7 +539,7 @@ def GNU : DiagGroup<"gnu", [GNUAlignofEx
                             GNUConditionalOmittedOperand,
                             GNUDesignator, GNUEmptyInitializer,
                             VLAExtension,
-                            GNULabelsAsValue, GNULocalLabel,
+                            GNULabelsAsValue,
                             GNUStatementExpression, GNUStaticFloatInit,
                             ZeroLengthArray]>;
 // A warning group for warnings about code that clang accepts but gcc doesn't.

Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=188840&r1=188839&r2=188840&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Tue Aug 20 17:44:32 2013
@@ -122,8 +122,6 @@ def ext_gnu_indirect_goto : Extension<
   "use of GNU indirect-goto extension">, InGroup<GNULabelsAsValue>;
 def ext_gnu_address_of_label : Extension<
   "use of GNU address-of-label extension">, InGroup<GNULabelsAsValue>;
-def ext_gnu_local_label : Extension<
-  "use of GNU locally declared label extension">, InGroup<GNULocalLabel>;
 def ext_gnu_statement_expr : Extension<
   "use of GNU statement expression extension">, InGroup<GNUStatementExpression>;
 def ext_gnu_conditional_expr : Extension<

Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=188840&r1=188839&r2=188840&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Tue Aug 20 17:44:32 2013
@@ -797,7 +797,6 @@ StmtResult Parser::ParseCompoundStatemen
   // only allowed at the start of a compound stmt regardless of the language.
   while (Tok.is(tok::kw___label__)) {
     SourceLocation LabelLoc = ConsumeToken();
-    Diag(LabelLoc, diag::ext_gnu_local_label);
 
     SmallVector<Decl *, 8> DeclsInGroup;
     while (1) {

Modified: cfe/trunk/test/Sema/gnu-flags.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/gnu-flags.c?rev=188840&r1=188839&r2=188840&view=diff
==============================================================================
--- cfe/trunk/test/Sema/gnu-flags.c (original)
+++ cfe/trunk/test/Sema/gnu-flags.c Tue Aug 20 17:44:32 2013
@@ -2,10 +2,10 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s -DALL -Wgnu 
 // RUN: %clang_cc1 -fsyntax-only -verify %s -DALL \
 // RUN:   -Wgnu-alignof-expression -Wgnu-case-range -Wgnu-complex-integer -Wgnu-conditional-omitted-operand \
-// RUN:   -Wgnu-empty-initializer -Wgnu-label-as-value -Wgnu-local-label -Wgnu-statement-expression
+// RUN:   -Wgnu-empty-initializer -Wgnu-label-as-value -Wgnu-statement-expression
 // RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE -Wgnu \
 // RUN:   -Wno-gnu-alignof-expression -Wno-gnu-case-range -Wno-gnu-complex-integer -Wno-gnu-conditional-omitted-operand \
-// RUN:   -Wno-gnu-empty-initializer -Wno-gnu-label-as-value -Wno-gnu-local-label -Wno-gnu-statement-expression
+// RUN:   -Wno-gnu-empty-initializer -Wno-gnu-label-as-value -Wno-gnu-statement-expression
 // RUNNOT: %clang_cc1 -fsyntax-only -verify %s -DALIGNOF -Wgnu-alignof-expression
 // RUNNOT: %clang_cc1 -fsyntax-only -verify %s -DNONE -Wno-gnu-alignof-expression
 // RUNNOT: %clang_cc1 -fsyntax-only -verify %s -DALIGNOF -DCASERANGE -Wgnu-case-range
@@ -13,7 +13,6 @@
 // RUNNOT: %clang_cc1 -fsyntax-only -verify %s -DALIGNOF -DOMITTEDOPERAND -Wgnu-conditional-omitted-operand
 // RUNNOT: %clang_cc1 -fsyntax-only -verify %s -DALIGNOF -DEMPTYINIT -Wgnu-empty-initializer
 // RUNNOT: %clang_cc1 -fsyntax-only -verify %s -DALIGNOF -DLABELVALUE -Wgnu-label-as-value
-// RUNNOT: %clang_cc1 -fsyntax-only -verify %s -DALIGNOF -DLOCALLABEL -Wgnu-local-label
 // RUNNOT: %clang_cc1 -fsyntax-only -verify %s -DALIGNOF -DSTATEMENTEXP -Wgnu-statement-expression
 
 #if NONE
@@ -73,21 +72,6 @@ foo:
 	goto *ptr;
 }
 
-
-#if ALL || LOCALLABEL
-// expected-warning at +5 {{use of GNU locally declared label extension}}
-#endif
-
-void locallabel() {
-	{
-		__label__ foo;
-		goto foo;
-foo:
-		;
-	}
-}
-
-
 #if ALL || STATEMENTEXP
 // expected-warning at +5 {{use of GNU statement expression extension}}
 #endif





More information about the cfe-commits mailing list