diff options
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 2 | ||||
-rw-r--r-- | lib/Sema/SemaType.cpp | 5 | ||||
-rw-r--r-- | test/CodeGen/imaginary.c | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 0927de34da..a00dc0ec11 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -2303,6 +2303,8 @@ def error_no_subobject_property_setting : Error< def ext_freestanding_complex : Extension< "complex numbers are an extension in a freestanding C99 implementation">; +// FIXME: Remove when we support imaginary. +def err_imaginary_not_supported : Error<"imaginary types are not supported">; // Obj-c expressions def warn_root_inst_method_not_found : Warning< diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index aa30b5c2da..254eb7984d 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -392,8 +392,9 @@ static QualType ConvertDeclSpecToType(Sema &TheSema, Result = Context.getVectorType(Result, 128/typeSize, AltiVecSpec); } - assert(DS.getTypeSpecComplex() != DeclSpec::TSC_imaginary && - "FIXME: imaginary types not supported yet!"); + // FIXME: Imaginary. + if (DS.getTypeSpecComplex() == DeclSpec::TSC_imaginary) + TheSema.Diag(DS.getTypeSpecComplexLoc(), diag::err_imaginary_not_supported); // See if there are any attributes on the declspec that apply to the type (as // opposed to the decl). diff --git a/test/CodeGen/imaginary.c b/test/CodeGen/imaginary.c new file mode 100644 index 0000000000..2649cebb20 --- /dev/null +++ b/test/CodeGen/imaginary.c @@ -0,0 +1,4 @@ +// RUN: %clang_cc1 -verify -emit-llvm-only %s + +// Just verify that we don't crash until we support _Imaginary. +double _Imaginary foo; // expected-error {{imaginary types are not supported}} |