Are you invoking Clang with "clang foo.cc" or "clang -cc1 foo.cc"? The
first should detect if you have a color capable terminal and automatically
turn on color diagnostics while the second needs the flag explicitly. The
other possibility is that the Clang you are using was compiled with the
libra
Hi Larry,
Right now, the template type diffing only works when there are two
templated types in the diagnostics message, and the templated types share
the same base. It your first example, the two types are vector and
vector.
In the second error message, only one type is printed with the diagnos
It sounds like you want the DeclContext. Use the function
Decl::getDeclContext() to get a DeclContext pointer. See
http://clang.llvm.org/doxygen/classclang_1_1DeclContext.html for details
about DeclContext. DeclContext::isTranslationUnit() for globals and
DeclContext::isFunctionOrMethod() for fu
Hi Ray,
First off, understand that the AST dumper provides a human readable view of
the AST that may be missing information and can change over time. It's
good for a quick look into Clang's AST, but there are better options for
tooling to work on the AST. (https://clang.llvm.org/docs/Tooling.htm
Hi Ayush,
First, you need to know the classes associated with each of your target AST
nodes. These are IfStmt, WhileStmt, ForStmt, BinaryOperator, and
UnaryOperator. Each of these are sub-classes of Stmt. IfStmt, WhileStmt,
ForStmt and direct sub-classes while BinaryOperator and UnaryOperator a
Adding back the mailing list. Please reply all to keep the discussion on
the mailing list.
On Thu, Aug 1, 2019 at 2:47 PM Ayush Mittal
wrote:
> Thanks Richard for the explanation. Really appreciate it.
> One quick question, Within VisitStmt (BinaryOperator) how could I get an
> access to DeclRe
RecursiveASTVisitor should have an ASTContext available. ASTContext has a
getParents function, which may be of some use. Unfortunately, I haven't
used this part of the ASTContext before, so I can't give any more concrete
advice. As you've seen, it's easier to traverse down the AST than up it.
O
The declarations are "ptr" and "bar". "*ptr" and "&bar" are expressions
since * and & are C++ operators. If you want the type of "*ptr" or "&bar",
then you need to get the associated UnaryOperator (a sub-class of Expr) and
call getType() on it.
On Wed, Aug 7, 2019 at 2:28 PM Ayush Mittal
wrote: