On Mar 18, 2013, at 3:30 PM, David Blaikie <[email protected]>  wrote:
> On Mon, Mar 18, 2013 at 10:45 AM, Marshall Clow <[email protected]> wrote:
>> Author: marshall
>> Date: Mon Mar 18 12:45:34 2013
>> New Revision: 177297
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=177297&view=rev
>> Log:
>> Removed raw references to __APPLE__; now just check to see if it is defined.
>> 
>> Modified:
>>    libcxx/trunk/include/__locale
>>    libcxx/trunk/include/iterator
>>    libcxx/trunk/include/locale
>>    libcxx/trunk/src/chrono.cpp
>>    libcxx/trunk/src/exception.cpp
>>    libcxx/trunk/src/new.cpp
>>    libcxx/trunk/src/stdexcept.cpp
>>    libcxx/trunk/src/typeinfo.cpp


> Strangely enough, this seems to have broken the Linux self hosting build as 
> follows:
> 
> src/projects/libcxx/src/typeinfo.cpp:17:28: error: __has_include must
> be used within a preprocessing directive
> #elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
>                           ^
> src/projects/libcxx/src/typeinfo.cpp:17:28: error: invalid token at
> start of a preprocessor expression
> <scratch space>:18:1: note: expanded from here
> 0
> ^
> 2 errors generated.
> 
> Experimenting a bit this compiles without error:
> #if FOO
> #elif __has_include(<foo>)
> #endif
> 
> But if you change the #if to #ifdef, it fails with the same error as
> above... probably a Clang bug, I assume.

Testing outside of libc++ shows:

        #ifdef FOO
        #define BAR 1
        #elif __has_include(<foo>)
        #define BAR 2
        #endif

        int main()
        {
                return 0;       
        }

fails to compile, but:

        #if FOO
        #define BAR 1
        #elif __has_include(<foo>)
        #define BAR 2
        #endif

        int main()
        {
                return 0;       
        }

succeeds.

-- Marshall



-- Marshall

Marshall Clow     Idio Software   <mailto:[email protected]>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly 
moderated down to (-1, Flamebait).
        -- Yu Suzuki


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to