From 6b3307abeea42f8080f3f0260d11b291490285fb Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Sat, 11 Feb 2017 18:00:32 +0000 Subject: [PATCH] Hopefully fixes a compile error introduced by r294861. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294862 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/TypeLoc.h | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/include/clang/AST/TypeLoc.h b/include/clang/AST/TypeLoc.h index 946e555a50..525f848a9f 100644 --- a/include/clang/AST/TypeLoc.h +++ b/include/clang/AST/TypeLoc.h @@ -75,22 +75,7 @@ public: /// adjustments from a type that wad written as a T to another type that is /// still canonically a T (ignores parens, attributes, elaborated types, etc). template - T getAsAdjusted() const { - TypeLoc Cur = *this; - while (!T::isKind(Cur)) { - if (auto PTL = Cur.getAs()) - Cur = PTL.getInnerLoc(); - else if (auto ATL = Cur.getAs()) - Cur = ATL.getModifiedLoc(); - else if (auto ETL = Cur.getAs()) - Cur = ETL.getNamedTypeLoc(); - else if (auto ATL = Cur.getAs()) - Cur = ATL.getOriginalLoc(); - else - break; - } - return Cur.getAs(); - } + T getAsAdjusted() const; /// The kinds of TypeLocs. Equivalent to the Type::TypeClass enum, /// except it also defines a Qualified enum that corresponds to the @@ -2210,6 +2195,24 @@ public: QualType getInnerType() const { return this->getTypePtr()->getElementType(); } }; + +template +inline T TypeLoc::getAsAdjusted() const { + TypeLoc Cur = *this; + while (!T::isKind(Cur)) { + if (auto PTL = Cur.getAs()) + Cur = PTL.getInnerLoc(); + else if (auto ATL = Cur.getAs()) + Cur = ATL.getModifiedLoc(); + else if (auto ETL = Cur.getAs()) + Cur = ETL.getNamedTypeLoc(); + else if (auto ATL = Cur.getAs()) + Cur = ATL.getOriginalLoc(); + else + break; + } + return Cur.getAs(); +} } #endif -- 2.40.0