summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/include/clang/Basic/DiagnosticSemaKinds.td2
-rw-r--r--clang/lib/Sema/SemaType.cpp5
-rw-r--r--clang/test/Sema/types.c4
3 files changed, 10 insertions, 1 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index cb947fadf77..c459192b297 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -1714,6 +1714,8 @@ def warn_missing_declspec : Warning<
def warn_missing_type_specifier : Warning<
"type specifier missing, defaults to 'int'">,
InGroup<ImplicitInt>;
+def err_decimal_unsupported : Error<
+ "GNU decimal type extension not supported">;
def err_missing_type_specifier : Error<
"C++ requires a type specifier for all declarations">;
def err_missing_param_declspec : Error<
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index d04a5ad6c59..972ac82b4cb 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -164,7 +164,10 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS,
case DeclSpec::TST_decimal32: // _Decimal32
case DeclSpec::TST_decimal64: // _Decimal64
case DeclSpec::TST_decimal128: // _Decimal128
- assert(0 && "FIXME: GNU decimal extensions not supported yet!");
+ Diag(DS.getTypeSpecTypeLoc(), diag::err_decimal_unsupported);
+ Result = Context.IntTy;
+ isInvalid = true;
+ break;
case DeclSpec::TST_class:
case DeclSpec::TST_enum:
case DeclSpec::TST_union:
diff --git a/clang/test/Sema/types.c b/clang/test/Sema/types.c
index 7ab4e0672ce..1232e472eae 100644
--- a/clang/test/Sema/types.c
+++ b/clang/test/Sema/types.c
@@ -30,3 +30,7 @@ int i[(short)1];
enum e { e_1 };
extern int j[sizeof(enum e)]; // expected-note {{previous definition}}
int j[42]; // expected-error {{redefinition of 'j' with a different type}}
+
+// rdar://6880104
+_Decimal32 x; // expected-error {{GNU decimal type extension not supported}}
+
OpenPOWER on IntegriCloud