diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-09-23 09:40:31 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-09-23 09:40:31 +0000 |
commit | 47423bdaa06a3b9c2a859b57c17fc570094dad1c (patch) | |
tree | b22570facdbc1e7f7efa634d6e28cb7c2a53bee0 | |
parent | 7d8eb519ce9b0e5434f185c04404bc817032e716 (diff) |
Don't crash on _Imaginary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114637 91177308-0d34-0410-b5e6-96231b3b80d8
-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}} |