[clang] Do not traverse EnumDecl's type in RecursiveASTVisitor
authorKirill Bobyrev <kbobyrev@google.com>
Tue, 26 Oct 2021 15:10:51 +0000 (17:10 +0200)
committerKirill Bobyrev <kbobyrev@google.com>
Tue, 26 Oct 2021 15:17:10 +0000 (17:17 +0200)
commit03506722e0c348ce52d87f7f37f024d7adec5c43
tree0c0493e879ab082de1be80cd038b917f1f129c0b
parent082d2ad015bdc3c70768d02beba905489daa1c0e
[clang] Do not traverse EnumDecl's type in RecursiveASTVisitor

This is inconsistent with the code and comments in
RecursiveASTVisitor.h and is not a correct behavior:

https://github.com/llvm/llvm-project/blob/main/clang/include/clang/AST/RecursiveASTVisitor.h#L1879-L1880

> We shouldn't traverse D->getTypeForDecl(); it's a result of
> declaring the type, not something that was written in the source.

Fixes the failures in 1c2e249f938c50e1b331a1f7adc83c0a381f3897
clang/include/clang/AST/RecursiveASTVisitor.h