]> granicus.if.org Git - clang/commitdiff
Fix non-MSVC build error in ASTContext::getAdjustedType
authorReid Kleckner <reid@kleckner.net>
Thu, 5 Dec 2013 01:41:37 +0000 (01:41 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 5 Dec 2013 01:41:37 +0000 (01:41 +0000)
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

lib/Sema/SemaType.cpp

index 63ac15baeb6a0dda203672559677aa3efaccb73e..6dfc235a142ad2521998db9b138e82257100200b 100644 (file)
@@ -4596,7 +4596,8 @@ static bool handleFunctionTypeAttr(TypeProcessingState &state,
 }
 
 void Sema::adjustMemberFunctionCC(QualType &T, bool IsStatic) {
-  const FunctionType *FT = T->castAs<FunctionType>();
+  FunctionTypeUnwrapper Unwrapped(*this, T);
+  const FunctionType *FT = Unwrapped.get();
   bool IsVariadic = (isa<FunctionProtoType>(FT) &&
                      cast<FunctionProtoType>(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