0
我有這樣的代碼片段:鐺:: ast_type_traits :: DynTypedNode ::得到()着推斷模板參數「T」
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();
基本上,它得到一個匹配節點的父級,然後如果一個 ImplicitCastExpr()
,我想獲得節點爲一個,並進一步 檢查。 當我嘗試編譯代碼,爲DynTypedNode::get()
,我得到這個:
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 {
這裏是從頭部聲明:
template <typename T>
const T *get() const {
return BaseConverter<T>::get(NodeKind, Storage.buffer);
}
我究竟做錯了什麼?