[clang] [Clang] Fix parsing of reversible type traits in template arguments (PR #95969)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 18 12:29:23 PDT 2024


================
@@ -141,3 +141,15 @@ namespace r360308_regression {
     return a == b;
   }
 }
+
+namespace GH95598 {
+template<typename _Tp, bool _IsPtr = __is_pointer(_Tp)>
+struct __is_pointer {};
+// expected-warning at -1 {{keyword '__is_pointer' will be made available as an identifier for the remainder of the translation unit}}
----------------
AaronBallman wrote:

This diagnostic is very confusing because it implies the name is only available as an identifier when in reality it's available as *either* an identifier or a keyword. This seems to be the original functionality though: https://godbolt.org/z/WzTs4T31j (based on the changes in https://github.com/llvm/llvm-project/commit/47642d2b7ea175a6c0d80bf14354246ca20af342 which added this diagnostic).

So I think your changes are aligned with the original intent of the diagnostic, but I've CCed @zygoloid and @rnk just in case others from this era recall differently.

https://github.com/llvm/llvm-project/pull/95969


More information about the cfe-commits mailing list