]> granicus.if.org Git - clang/commit
Let RecursiveASTVisitor walk both syntactic and semantic form of InitListExprs.
authorDaniel Jasper <djasper@google.com>
Wed, 4 Feb 2015 13:11:42 +0000 (13:11 +0000)
committerDaniel Jasper <djasper@google.com>
Wed, 4 Feb 2015 13:11:42 +0000 (13:11 +0000)
commitf589bba74c4132b7206d755404dc94776c37255c
treec51a5a7840df049bdcf7ca3c28da129c12bb13c6
parent0e542acb983bb667cdc6e52948510c47c2ba28e9
Let RecursiveASTVisitor walk both syntactic and semantic form of InitListExprs.

Otherwise, this can lead to unexpected results when AST matching as
some nodes are only present in the semantic form.

For example, only looking at the syntactic form does not find the
DeclRefExpr to f() in:

  struct S { S(void (*a)()); };
  void f();
  S s[1] = {&f};

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228138 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/RecursiveASTVisitor.h
unittests/ASTMatchers/ASTMatchersTest.cpp