[cfe-dev] Const qualifiers on reference types

Victor Vicente de Carvalho victor.v.carvalho at gmail.com
Sun Jul 7 16:20:10 PDT 2013


Right, sorry. Had somewhere in my mind that getPointeeType returned a Type*
instead a QualType.


Thanks


2013/7/7 Richard Smith <richard at metafoo.co.uk>

> On Sun, Jul 7, 2013 at 3:46 PM, Victor Vicente de Carvalho
> <victor.v.carvalho at gmail.com> wrote:
> > I'm having a hard time recovering the const qualifier for a function that
> > returns a const & QualType. QualType::isConstQualified and
> > QualType::isLocalConstQualified are returning false and
> > getLocalCVRQualifiers , getCVRQualifiers are returning 0.
> getNameAsString is
> > returning const on the name. There is a different way to recover the
> > constness when the object is a reference?
>
> A reference can't be const. Call getPointeeType to find the type that
> the reference refers to, and apply isConstQualified to that.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130707/fac388f5/attachment.html>


More information about the cfe-dev mailing list