]> granicus.if.org Git - clang/commitdiff
revert patch r216469.
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 26 Aug 2014 21:10:47 +0000 (21:10 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 26 Aug 2014 21:10:47 +0000 (21:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216485 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp
test/CodeGen/ms-anonymous-struct.c
test/Parser/declarators.c
test/Sema/MicrosoftExtensions.c
test/Sema/anonymous-struct-union.c
test/SemaObjC/ivar-lookup.m

index b6c0971619917ff26ef0bbdf02bd99b249a213b6..0079c4925ac1c1a55946dd9432d92221590a43b9 100644 (file)
@@ -3450,7 +3450,7 @@ Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
   // C11 6.7.2.1p2:
   //   A struct-declaration that does not declare an anonymous structure or
   //   anonymous union shall contain a struct-declarator-list.
-  if (getLangOpts().C11 && CurContext->isRecord() &&
+  if (!getLangOpts().CPlusPlus && CurContext->isRecord() &&
       DS.getStorageClassSpec() == DeclSpec::SCS_unspecified) {
     // Check for Microsoft C extension: anonymous struct/union member.
     // Handle 2 kinds of anonymous struct/union:
index ea6b42aff20ac227dc8ed60e2fd4ffed12e08813..b41caab0309ef16dc49b40519600b6652734197b 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c11 -fms-extensions -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -fms-extensions -emit-llvm -o - %s | FileCheck %s
 
 // CHECK: %struct.test = type { i32, %struct.nested2, i32 }
 // CHECK: %struct.nested2 = type { i32, %struct.nested1, i32 }
index 3b28c5c2b267929bef5c85590f59ae5a324c7bf8..48936d59226968bb6d5a0d6c4abb642d926921ab 100644 (file)
@@ -113,6 +113,7 @@ enum E1 { e1 }: // expected-error {{expected ';'}}
 struct EnumBitfield { // expected-warning {{struct without named members is a GNU extension}}
   enum E2 { e2 } : 4; // ok
   struct S { int n; }: // expected-error {{expected ';'}}
+                       // expected-warning@-1 {{declaration does not declare anything}}
 
 };
 
index b3030fff10f59103e560e16b7410663d02546842..908ec04876e2332c99da34591b079e5259ee3623 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c11 -triple i686-windows %s -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-extensions
+// RUN: %clang_cc1 -triple i686-windows %s -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-extensions
 
 
 struct A
index 2d1391133dd3ec907f7bd0f6476bd738b744f6cb..26dbeb87f5fab40d5ad0d452da1d7b084312eacf 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c11 -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
 struct X {
   union {
     float f3;
index b2a1105f312459712b82a2d68a413703a05f15bd..57f432c717a191be63ded6531cfd797d3bc7ec4b 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c11 -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
 
 @interface Test {
    int x;