Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] (C/C++ AST API) const/volatile/... qualifiers for IType or IVariable

On 2014-09-26 07:25 AM, Dmitry Petrov wrote:
> Is there a concise way to obtain const/volatile/... type qualifiers for a given IType (or at least for a given IVariable)?
> IType doesn't seem to provide qualifiers in general case.
> In fact, I have a bit simpler question: for a given IVariable, tell if it's const.
> It looks like I need to find a declaration (and its decl specifier), which looks very close to an overkill.
> Is there a simpler way to do that using public API?

I might be completely off target here, but: IVariable implements IDeclaration, which has isStatic, isConst, isVolatile. Isn't it what you want?

As far as I understand, a Type can't be const/volatile/static, so you can't get that from an IType. They apply to a variable declaration.


Back to the top