Author: rnk
Date: Wed Dec  4 19:41:37 2013
New Revision: 196455

URL: http://llvm.org/viewvc/llvm-project?rev=196455&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/Sema/SemaType.cpp

Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=196455&r1=196454&r2=196455&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Wed Dec  4 19:41:37 2013
@@ -4596,7 +4596,8 @@ static bool handleFunctionTypeAttr(TypeP
 }
 
 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(QualTy
   }
 
   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


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to