[cfe-dev] DynTypedNode::get() cant infer template argument 'T'

Farzad Sadeghi via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 30 04:29:57 PST 2016


i have this code snippet:

ASTContext::DynTypedNodeList NodeList = ASTC->getParents(*DRE);
ast_type_traits::DynTypedNode ParentNode = NodeList[0];
/*some code here to determine if the NodeKind is ImplicitCastExpr*/
const ImplicitCastExpr* ParentICE = ParentNode.get();


basically, its getting the parent of a match-node and then if its an
ImplicitCastExpr(), i want to get the node as one and do some further
checks.
when i try to compile the code, for DynTypedNode::get(), i get this:

mutator-lvl0.cpp:1644:30: error: no matching member function for call to 'get'
      ParentICE = ParentNode.get();
                  ~~~~~~~~~~~^~~
/home/bloodstalker/llvm/llvm/llvm/tools/clang/include/clang/AST/ASTTypeTraits.h:233:12:
note: candidate template ignored: couldn't infer template argument 'T'
  const T *get() const {
           ^
what am i doing wrong?


-- 
Farzad Sadeghi



More information about the cfe-dev mailing list