[cfe-dev] How can I check if the qualifiers of a type has a class in it?

Nikola Smiljanic popizdeh at gmail.com
Mon Jun 30 21:58:44 PDT 2014


It looks like you're looking for NestedNameSpecifier. You should check the
Kind and traverse the Prefix. I don't know how you obtain the type as it
can appear in various contexts, but assuming you have some kind of Decl
object on your hands you can call the the getQualifier() method.


On Sun, Jun 29, 2014 at 5:30 PM, Manasij Mukherjee <manasij7479 at gmail.com>
wrote:

> It seems I made a mistake in terminology.
>
> What is the following called?
> Suppose I have the types:
> MyNamespace::ClassName
> MyNamespace::ClassName::iterator
> The second type has MyNamespace::ClassName as its scope (?).
>
> I want to detect if there are only namespaces there or a class somewhere
> in the scope .
>
>
>
> On Sun, Jun 29, 2014 at 9:59 AM, Nikola Smiljanic <popizdeh at gmail.com>
> wrote:
>
>> What do you mean by 'if the qualifiers include a class name"?
>>
>> Qualifiers class deals with const, volatile, etc.
>>
>>
>>  On Sun, Jun 29, 2014 at 12:40 AM, Manasij Mukherjee <
>> manasij7479 at gmail.com> wrote:
>>
>>>  Hi
>>> I get the  qualifiers like this:
>>> Qualifiers q = qualifiedType.getQualifiers();
>>>
>>> How can I check whether if the qualifiers include a class name ?
>>>
>>> I can not figure out how to find this information from the Qualifiers
>>> interface.
>>>
>>> Types in namespaces ..single or nested.. should not trigger this check.
>>>
>>> Thanks
>>> Manasij Mukherjee
>>>
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140701/a30adb9d/attachment.html>


More information about the cfe-dev mailing list