================
@@ -38,7 +38,9 @@ AST_MATCHER(Type, sugaredNullptrType) {
 StatementMatcher makeCastSequenceMatcher(llvm::ArrayRef<StringRef> NameList) {
   auto ImplicitCastToNull = implicitCastExpr(
       anyOf(hasCastKind(CK_NullToPointer), 
hasCastKind(CK_NullToMemberPointer)),
-      
unless(hasImplicitDestinationType(qualType(substTemplateTypeParmType()))),
+      anyOf(hasSourceExpression(gnuNullExpr()),
----------------
tkoeppe wrote:

This is explained somewhat in the unit test: When `NULL` is defined to 
`__null`, then this change will catch both cases. But we don't have a direct 
check for "the origin was the macro `NULL`", I'm afraid. @zygoloid suggested 
this change as a reasonable, small change that will be effective in many 
real-world cases.

I'd be happy to have a more general solution, but couldn't find one, and the 
present one will already do a lot of good. What do you think?

https://github.com/llvm/llvm-project/pull/109169
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to