[cfe-commits] r130136 - /cfe/trunk/lib/Sema/SemaOverload.cpp
Douglas Gregor
dgregor at apple.com
Mon Apr 25 11:40:17 PDT 2011
Author: dgregor
Date: Mon Apr 25 13:40:17 2011
New Revision: 130136
URL: http://llvm.org/viewvc/llvm-project?rev=130136&view=rev
Log:
Minor tweak to avoid having to dig through canonical types multiple times when checking a qualification conversion
Modified:
cfe/trunk/lib/Sema/SemaOverload.cpp
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=130136&r1=130135&r2=130136&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Mon Apr 25 13:40:17 2011
@@ -2171,21 +2171,24 @@
// unwrap.
UnwrappedAnyPointer = true;
+ Qualifiers FromQuals = FromType.getQualifiers();
+ Qualifiers ToQuals = ToType.getQualifiers();
+
// -- for every j > 0, if const is in cv 1,j then const is in cv
// 2,j, and similarly for volatile.
- if (!CStyle && !ToType.isAtLeastAsQualifiedAs(FromType))
+ if (!CStyle && !ToQuals.compatiblyIncludes(FromQuals))
return false;
// -- if the cv 1,j and cv 2,j are different, then const is in
// every cv for 0 < k < j.
- if (!CStyle && FromType.getCVRQualifiers() != ToType.getCVRQualifiers()
+ if (!CStyle && FromQuals.getCVRQualifiers() != ToQuals.getCVRQualifiers()
&& !PreviousToQualsIncludeConst)
return false;
// Keep track of whether all prior cv-qualifiers in the "to" type
// include const.
PreviousToQualsIncludeConst
- = PreviousToQualsIncludeConst && ToType.isConstQualified();
+ = PreviousToQualsIncludeConst && ToQuals.hasConst();
}
// We are left with FromType and ToType being the pointee types
More information about the cfe-commits
mailing list