From: Reid Kleckner Date: Thu, 5 Dec 2013 01:41:37 +0000 (+0000) Subject: Fix non-MSVC build error in ASTContext::getAdjustedType X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a0b7e92af1c105e9ea7ce1b6006aecd3ebe09eb;p=clang Fix non-MSVC build error in ASTContext::getAdjustedType Use FunctionTypeUnwrapper like we do in AttributedType to try to keep some sugar. We can actually do one better here in the future by avoiding the AdjustedType node altogether when no sugar would be lost. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196455 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 63ac15baeb..6dfc235a14 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -4596,7 +4596,8 @@ static bool handleFunctionTypeAttr(TypeProcessingState &state, } void Sema::adjustMemberFunctionCC(QualType &T, bool IsStatic) { - const FunctionType *FT = T->castAs(); + FunctionTypeUnwrapper Unwrapped(*this, T); + const FunctionType *FT = Unwrapped.get(); bool IsVariadic = (isa(FT) && cast(FT)->isVariadic()); @@ -4621,7 +4622,8 @@ void Sema::adjustMemberFunctionCC(QualType &T, bool IsStatic) { } FT = Context.adjustFunctionType(FT, FT->getExtInfo().withCallingConv(ToCC)); - T = Context.getAdjustedType(T, QualType(FT, T.getQualifiers())); + QualType Wrapped = Unwrapped.wrap(*this, FT); + T = Context.getAdjustedType(T, Wrapped); } /// Handle OpenCL image access qualifiers: read_only, write_only, read_write