From: Fariborz Jahanian Date: Tue, 26 Aug 2014 21:10:47 +0000 (+0000) Subject: revert patch r216469. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=63823dea71d3f45bc69ba3ba3dec7e4361db6ee1;p=clang revert patch r216469. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216485 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index b6c0971619..0079c4925a 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -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: diff --git a/test/CodeGen/ms-anonymous-struct.c b/test/CodeGen/ms-anonymous-struct.c index ea6b42aff2..b41caab030 100644 --- a/test/CodeGen/ms-anonymous-struct.c +++ b/test/CodeGen/ms-anonymous-struct.c @@ -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 } diff --git a/test/Parser/declarators.c b/test/Parser/declarators.c index 3b28c5c2b2..48936d5922 100644 --- a/test/Parser/declarators.c +++ b/test/Parser/declarators.c @@ -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}} }; diff --git a/test/Sema/MicrosoftExtensions.c b/test/Sema/MicrosoftExtensions.c index b3030fff10..908ec04876 100644 --- a/test/Sema/MicrosoftExtensions.c +++ b/test/Sema/MicrosoftExtensions.c @@ -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 diff --git a/test/Sema/anonymous-struct-union.c b/test/Sema/anonymous-struct-union.c index 2d1391133d..26dbeb87f5 100644 --- a/test/Sema/anonymous-struct-union.c +++ b/test/Sema/anonymous-struct-union.c @@ -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; diff --git a/test/SemaObjC/ivar-lookup.m b/test/SemaObjC/ivar-lookup.m index b2a1105f31..57f432c717 100644 --- a/test/SemaObjC/ivar-lookup.m +++ b/test/SemaObjC/ivar-lookup.m @@ -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;