[llvm-branch-commits] [cfe-branch] r71664 - in /cfe/branches/Apple/Dib: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaType.cpp test/Sema/types.c

Mike Stump mrs at apple.com
Wed May 13 08:29:48 PDT 2009


Author: mrs
Date: Wed May 13 10:29:39 2009
New Revision: 71664

URL: http://llvm.org/viewvc/llvm-project?rev=71664&view=rev
Log:
Merge in 71639:

reject use of the GNU _Decimal32 extension with a diagnostic, not an abort.
rdar://6880104

Modified:
    cfe/branches/Apple/Dib/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/branches/Apple/Dib/lib/Sema/SemaType.cpp
    cfe/branches/Apple/Dib/test/Sema/types.c

Modified: cfe/branches/Apple/Dib/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/include/clang/Basic/DiagnosticSemaKinds.td?rev=71664&r1=71663&r2=71664&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/branches/Apple/Dib/include/clang/Basic/DiagnosticSemaKinds.td Wed May 13 10:29:39 2009
@@ -1702,6 +1702,8 @@
 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<

Modified: cfe/branches/Apple/Dib/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/lib/Sema/SemaType.cpp?rev=71664&r1=71663&r2=71664&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/lib/Sema/SemaType.cpp (original)
+++ cfe/branches/Apple/Dib/lib/Sema/SemaType.cpp Wed May 13 10:29:39 2009
@@ -164,7 +164,10 @@
   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:

Modified: cfe/branches/Apple/Dib/test/Sema/types.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/test/Sema/types.c?rev=71664&r1=71663&r2=71664&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/test/Sema/types.c (original)
+++ cfe/branches/Apple/Dib/test/Sema/types.c Wed May 13 10:29:39 2009
@@ -30,3 +30,7 @@
 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}}
+





More information about the llvm-branch-commits mailing list