Index: lib/Analysis/Consumed.cpp =================================================================== --- lib/Analysis/Consumed.cpp +++ lib/Analysis/Consumed.cpp @@ -142,10 +142,13 @@ } static bool isConsumableType(const QualType &QT) { + if (QT->isPointerType() || QT->isReferenceType()) + return false; + if (const CXXRecordDecl *RD = QT->getAsCXXRecordDecl()) return RD->hasAttr(); - else - return false; + + return false; } static bool isKnownState(ConsumedState State) { @@ -163,7 +166,8 @@ static bool isRValueRefish(QualType ParamType) { return ParamType->isRValueReferenceType() || (ParamType->isLValueReferenceType() && - !cast(*ParamType).isSpelledAsLValue()); + !cast( + ParamType.getCanonicalType())->isSpelledAsLValue()); } static bool isTestingFunction(const FunctionDecl *FunDecl) { @@ -864,7 +868,7 @@ const ParamTypestateAttr *PTAttr = Param->getAttr(); ParamState = mapParamTypestateAttrState(PTAttr); - } else if (isValueType(ParamType) && isConsumableType(ParamType)) { + } else if (isConsumableType(ParamType)) { ParamState = mapConsumableAttrState(ParamType); } else if (isRValueRefish(ParamType) &&