diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index 934bd0db1e0191cb6868395e5ce5322f78bab623..50427cc8e39d9e1cafda42c35e3c6bfcb39f7aee 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -35,6 +35,7 @@ def ext_thread_before : Extension<"'__thread' before 'static'">; def ext_empty_struct_union_enum : Extension<"use of empty %0 extension">; +def error_empty_enum : Error<"use of empty union">; def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">; def err_invalid_short_spec : Error<"'short %0' is invalid">; def err_invalid_long_spec : Error<"'long %0' is invalid">; diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 3e7d4a13c5df54cf000c5a2fd53b19926203550b..76da13500a415a11906d40a47b89be0c8ebd0078 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -2013,7 +2013,7 @@ void Parser::ParseEnumBody(SourceLocation StartLoc, DeclPtrTy EnumDecl) { // C does not allow an empty enumerator-list, C++ does [dcl.enum]. if (Tok.is(tok::r_brace) && !getLang().CPlusPlus) - Diag(Tok, diag::ext_empty_struct_union_enum) << "enum"; + Diag(Tok, diag::error_empty_enum); llvm::SmallVector<DeclPtrTy, 32> EnumConstantDecls; diff --git a/test/CodeGen/typedef-func.c b/test/CodeGen/typedef-func.c index bc08b359d70f670e8c56d60063ab31e900e25cc1..1467e8b1f74a9341104681a6f01925a11bc91404 100644 --- a/test/CodeGen/typedef-func.c +++ b/test/CodeGen/typedef-func.c @@ -2,7 +2,7 @@ // PR2414 struct mad_frame{}; -enum mad_flow {}; +enum mad_flow {ont}; typedef enum mad_flow filter_func_t(void *, struct mad_frame *); diff --git a/test/Sema/enum.c b/test/Sema/enum.c index ba4e56b907a72c667dc736c11005d4ff16ed3196..4a5771d66b6fd4d32bab7aa3183b58205206554b 100644 --- a/test/Sema/enum.c +++ b/test/Sema/enum.c @@ -51,7 +51,7 @@ void test4() { } // PR2416 -enum someenum {}; // expected-warning {{use of empty enum extension}} +enum someenum {}; // expected-error {{use of empty union}} // <rdar://problem/6093889> enum e0 { // expected-note {{previous definition is here}} diff --git a/test/Sema/function-redecl.c b/test/Sema/function-redecl.c index 633ad214236a28129e0680580a3776416673539d..27ec163ea9cb8154d09ce74dcb4975bd1629edd3 100644 --- a/test/Sema/function-redecl.c +++ b/test/Sema/function-redecl.c @@ -126,6 +126,6 @@ void test_x() { x2(5); // expected-warning{{incompatible integer to pointer conversion passing 'int' to parameter of type 'int *'}} } -enum e0 {}; +enum e0 {one}; void f3(); void f3(enum e0 x) {}