diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-02-14 21:06:05 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-02-14 21:06:05 +0000 |
commit | f244cd7e54753caf6edb76df430dea2f43bb82a8 (patch) | |
tree | 324ff9e2d2c9d79dfac6ec8d20b7d39595ecaa80 /lib/Sema/SemaType.cpp | |
parent | 3573c0c0b44a1ac8f76a00af1bc75e94ca03d704 (diff) |
Add a test case for -ffreestanding that redefines malloc.
Warn that complex numbers are an extension in a freestanding C99
implementation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64568 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index e898782f31..00bfb13561 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -170,8 +170,11 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS) { } // Handle complex types. - if (DS.getTypeSpecComplex() == DeclSpec::TSC_complex) + if (DS.getTypeSpecComplex() == DeclSpec::TSC_complex) { + if (getLangOptions().Freestanding) + Diag(DS.getTypeSpecComplexLoc(), diag::ext_freestanding_complex); Result = Context.getComplexType(Result); + } assert(DS.getTypeSpecComplex() != DeclSpec::TSC_imaginary && "FIXME: imaginary types not supported yet!"); |