5

I'm trying to parse function attributes using libClang but so far am unnsuccessful.

For example, I may have an attribute like this defined in a header.

#define __mobile__ __attribute__((mobile))

And in a separate .cpp file I have my function definition:

<template T>
__mobile__ void run(T int){...}

I've been spending the day toying with the libClang library and interfacing through it with C++.

So far I haven't been able to tell if the function contains such an attribute. The method clang_Cursor_hasAttrs returns 0 for the cursor run, which is of kind CXCursor_FunctionTemplate.

ProgrammingRain
  • 173
  • 1
  • 1
  • 6

0 Answers0