]> granicus.if.org Git - clang/commitdiff
reject use of the GNU _Decimal32 extension with a diagnostic, not an abort.
authorChris Lattner <sabre@nondot.org>
Wed, 13 May 2009 05:02:08 +0000 (05:02 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 13 May 2009 05:02:08 +0000 (05:02 +0000)
rdar://6880104

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71639 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaType.cpp
test/Sema/types.c

index cb947fadf7770d79a21e1fb1ed13c27c3dea59a1..c459192b297c18761ef72d3c7a33a97308d117d7 100644 (file)
@@ -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<
index d04a5ad6c591b8f00b787bc0de1fdb089940cc92..972ac82b4cb80736d152638868422f5ac8c2536c 100644 (file)
@@ -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:
index 7ab4e0672ce6a2450926034481b46d8c6ddcc3ba..1232e472eaea52eeaff987edc24fb11ddd830981 100644 (file)
@@ -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}}
+