[cfe-dev] a question regarding clang::Type::isFunctionPointerType()

Farzad Sadeghi via cfe-dev cfe-dev at lists.llvm.org
Sat Dec 10 00:48:39 PST 2016


ok, thank you very much.

On 12/10/16, Erik Pilkington <erik.pilkington at gmail.com> wrote:
> Well, only the first is a pointer to a function, the others are pointers to
> pointers to functions. I guess you probably would want to drill down through
> the type, using PointerType::getPointeeType() until you reach the function
> pointer, then check to see if that is a pointer to a function.
> - Erik
>
>> On Dec 9, 2016, at 5:44 PM, Farzad Sadeghi via cfe-dev
>> <cfe-dev at lists.llvm.org> wrote:
>>
>> i have these four function pointer types:
>> 	int ** (*pfunc1)();
>> 	int ** (**pfunc2)();
>> 	int ** (***pfunc3)();
>> 	int *** (**pfunc4)();
>> when i use isFunctionPointerType() on them, only the first declaration
>> is recognized as a function pointer.
>> I'm using C90 and the clang::Type is from a QualType acquired from
>> QualType::getCanonicalType(). i get the same behavior from a
>> clang::Type that was acquired from a VarDecl::getType().
>> Obviouly my getting the wrong QualType and/or clang::Type. which one
>> should i e getting so that all four of these declarations are
>> recognized as function pointers?
>>
>>
>> --
>> Farzad Sadeghi
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>


-- 
Farzad Sadeghi



More information about the cfe-dev mailing list