[PATCH] AST: Handle elaborated type in getIntWidth

Richard Smith richard at metafoo.co.uk
Mon Oct 14 21:59:37 PDT 2013


Special-casing ElaboratedType is not the right fix (this is a general
problem with any kind of type sugar). Fixed by switching from dyn_cast to
Type::getAs in r192671.


On Wed, Oct 9, 2013 at 9:58 PM, Justin Bogner <mail at justinbogner.com> wrote:

> In getIntWidth we special case enums and boolean types, but this
> handling can be defeated if the type is hidden inside an
> ElaboratedType. Notably, scoped enum bools in a namespace that are
> referred to by a fully qualified name skip past both checks.
>
> This then causes an assert when something of that type is involved in an
> implicit cast.
>
> We can avoid this by explicitly stripping the elaborated type.
>
> Okay to commit?
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131014/2167f302/attachment.html>


More information about the cfe-commits mailing list