diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Headers/tgmath.h | 4 | ||||
-rw-r--r-- | clang/test/Modules/compiler_builtins.m | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Headers/tgmath.h b/clang/lib/Headers/tgmath.h index 1b0b9d24c1d..554af6cf740 100644 --- a/clang/lib/Headers/tgmath.h +++ b/clang/lib/Headers/tgmath.h @@ -30,7 +30,9 @@ /* C++ handles type genericity with overloading in math.h. */ #ifndef __cplusplus -#include <complex.h> +#if __has_include(<complex.h>) +# include <complex.h> +#endif #define _TG_ATTRSp __attribute__((__overloadable__)) #define _TG_ATTRS __attribute__((__overloadable__, __always_inline__)) diff --git a/clang/test/Modules/compiler_builtins.m b/clang/test/Modules/compiler_builtins.m index 5874722c6b8..3545604414a 100644 --- a/clang/test/Modules/compiler_builtins.m +++ b/clang/test/Modules/compiler_builtins.m @@ -1,5 +1,5 @@ // RUN: rm -rf %t -// RUN: %clang -fsyntax-only -fmodules -fmodule-cache-path %t %s +// RUN: %clang -fsyntax-only -fmodules -fmodule-cache-path %t %s -Xclang -verify @import __compiler_builtins.float_constants; @@ -9,4 +9,4 @@ float getFltMax() { return FLT_MAX; } char getCharMax() { return CHAR_MAX; } -//size_t size; // expected-error{{unknown type name 'size_t'}} +size_t size; // expected-error{{unknown type name 'size_t'}} |