// 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:
-// 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 }
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}}
};
-// 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
-// RUN: %clang_cc1 -fsyntax-only -std=c11 -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
struct X {
union {
float f3;
-// 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;