[cfe-commits] r85956 - /cfe/trunk/lib/Sema/SemaExpr.cpp

Douglas Gregor dgregor at apple.com
Wed Nov 4 13:11:22 PST 2009


On Nov 4, 2009, at 12:37 PM, Daniel Dunbar <daniel at zuster.org> wrote:

> On Tue, Nov 3, 2009 at 2:20 PM, Mike Stump <mrs at apple.com> wrote:
>> Author: mrs
>> Date: Tue Nov  3 16:20:01 2009
>> New Revision: 85956
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=85956&view=rev
>> Log:
>> We have to ensure we have the canonical type to do this.  This is but
>> one instance of a large problem.  assert for non-canoical types would
>> help track down these things.
>
> How often does it make sense to get the CVR qualifiers on a
> non-canonical type?

Printing and minimal desugaring are the only cases I can think of.

> If its rare enough, we could statically drop that
> ability and use a different more-obviously-special method to do so.

I think the is the right way to go.

   - Doug

>
>> Modified:
>>    cfe/trunk/lib/Sema/SemaExpr.cpp
>>
>> Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=85956&r1=85955&r2=85956&view=diff
>>
>> ===
>> ===
>> ===
>> =====================================================================
>> --- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
>> +++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Nov  3 16:20:01 2009
>> @@ -1098,7 +1098,8 @@
>>     //    - a constant with integral or enumeration type and is
>>     //      initialized with an expression that is value-dependent
>>     else if (const VarDecl *Dcl = dyn_cast<VarDecl>(VD)) {
>> -      if (Dcl->getType().getCVRQualifiers() == Qualifiers::Const &&
>> +      if (Context.getCanonicalType(Dcl->getType()).getCVRQualifiers 
>> ()
>> +          == Qualifiers::Const &&
>>           Dcl->getInit()) {
>>         ValueDependent = Dcl->getInit()->isValueDependent();
>>       }
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list