Index: include/clang/ASTMatchers/ASTMatchers.h =================================================================== --- include/clang/ASTMatchers/ASTMatchers.h +++ include/clang/ASTMatchers/ASTMatchers.h @@ -1441,6 +1441,11 @@ Stmt, CXXNullPtrLiteralExpr> nullPtrLiteralExpr; +/// \brief Matches GNU __null expression. +const internal::VariadicDynCastAllOfMatcher< + Stmt, + GNUNullExpr> gnuNullExpr; + /// \brief Matches binary operator expressions. /// /// Example matches a || b Index: unittests/ASTMatchers/ASTMatchersTest.cpp =================================================================== --- unittests/ASTMatchers/ASTMatchersTest.cpp +++ unittests/ASTMatchers/ASTMatchersTest.cpp @@ -2144,6 +2144,10 @@ EXPECT_TRUE(matches("int* i = nullptr;", nullPtrLiteralExpr())); } +TEST(Matcher, GNUNullExpr) { + EXPECT_TRUE(matches("int* i = __null;", gnuNullExpr())); +} + TEST(Matcher, AsmStatement) { EXPECT_TRUE(matches("void foo() { __asm(\"mov al, 2\"); }", asmStmt())); }