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

Daniel Dunbar daniel at zuster.org
Wed Nov 4 12:37:45 PST 2009


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? If its rare enough, we could statically drop that
ability and use a different more-obviously-special method to do so.

 - Daniel

> 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
>




More information about the cfe-commits mailing list