Hi,
I ran into a situation where a C++ program was compiled with -Wsystem-headers. When I did this with clang 3.4 or trunk, I got the following keyword warnings:
In file included from include/algorithm:624:
include/type_traits:288:29: warning: keyword '__is_void' will be made available as an identifier for the remainder of the translation unit [-Wkeyword-compat]
template <class _Tp> struct __is_void : public false_type {};
^
include/type_traits:309:29: warning: keyword '__is_integral' will be made available as an identifier for the remainder of the translation unit [-Wkeyword-compat]
template <class _Tp> struct __is_integral : public false_type {};
^
include/type_traits:333:29: warning: keyword '__is_floating_point' will be made available as an identifier for the remainder of the translation unit [-Wkeyword-compat]
template <class _Tp> struct __is_floating_point : public false_type {};
^
include/type_traits:352:29: warning: keyword '__is_pointer' will be made available as an identifier for the remainder of the translation unit [-Wkeyword-compat]
template <class _Tp> struct __is_pointer : public false_type {};
^
include/type_traits:432:8: warning: keyword '__is_function' will be made available as an identifier for the remainder of the translation unit [-Wkeyword-compat]
struct __is_function
^
include/type_traits:442:40: warning: keyword '__is_member_function_pointer' will be made available as an identifier for the remainder of the translation unit [-Wkeyword-compat]
template <class _Tp> struct __is_member_function_pointer : public false_type {};
^
include/type_traits:450:40: warning: keyword '__is_member_pointer' will be made available as an identifier for the remainder of the translation unit [-Wkeyword-compat]
template <class _Tp> struct __is_member_pointer : public false_type {};
^
include/type_traits:653:8: warning: keyword '__is_signed' will be made available as an identifier for the remainder of the translation unit [-Wkeyword-compat]
struct __is_signed : public ___is_signed<_Tp> {};
^
include/type_traits:668:8: warning: keyword '__is_unsigned' will be made available as an identifier for the remainder of the translation unit [-Wkeyword-compat]
struct __is_unsigned : public ___is_unsigned<_Tp> {};
^
9 warnings generated.
This seems to have been introduced with r196212 in clang by Alp Toker, but it is unfortunate the warning hits libc++. The cause is a bunch of Embarcadero keywords defined in clang's lib/Parse/ParseExpr.cpp, which are exactly the same as these libc++-internal identifers.
Is the attached patch acceptable as a workaround?
-Dimitry
avoid-keywords-1.diff (8.37 KB)