From: Douglas Gregor Date: Sun, 29 Jan 2012 22:35:57 +0000 (+0000) Subject: If there's no math.h, then tgmath.h should just be empty X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ad2649083d75f2d3cfac7b56e0dc391d6e29541;p=clang If there's no math.h, then tgmath.h should just be empty git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149209 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Headers/tgmath.h b/lib/Headers/tgmath.h index 1b0b9d24c1..0617ae2ddb 100644 --- a/lib/Headers/tgmath.h +++ b/lib/Headers/tgmath.h @@ -26,6 +26,7 @@ #define __TGMATH_H /* C99 7.22 Type-generic math . */ +#if __has_include() #include /* C++ handles type genericity with overloading in math.h. */ @@ -1354,4 +1355,5 @@ static long double #undef _TG_ATTRS #endif /* __cplusplus */ +#endif /* __has_include() */ #endif /* __TGMATH_H */ diff --git a/test/Modules/compiler_builtins.m b/test/Modules/compiler_builtins.m index 254494a242..3cf24142d3 100644 --- a/test/Modules/compiler_builtins.m +++ b/test/Modules/compiler_builtins.m @@ -1,5 +1,5 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t %s +// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -verify %s @import __compiler_builtins.float_constants; @@ -9,5 +9,4 @@ float getFltMax() { return FLT_MAX; } char getCharMax() { return CHAR_MAX; } -// FIXME: Re-enable this test. -//size_t size; // expected-error{{unknown type name 'size_t'}} +size_t size; // expected-error{{unknown type name 'size_t'}}