aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Basic/DiagnosticParseKinds.td1
-rw-r--r--lib/Parse/ParseDecl.cpp2
-rw-r--r--test/CodeGen/typedef-func.c2
-rw-r--r--test/Sema/enum.c2
-rw-r--r--test/Sema/function-redecl.c2
5 files changed, 5 insertions, 4 deletions
diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td
index 934bd0db1e..50427cc8e3 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 3e7d4a13c5..76da13500a 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 bc08b359d7..1467e8b1f7 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 ba4e56b907..4a5771d66b 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 633ad21423..27ec163ea9 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) {}