[cfe-dev] Accessing c++11 in class initializer AST nodes from lib clang

Derek Ney derekney at gmail.com
Tue Feb 24 08:06:34 PST 2015


I am working on some code generation tools that use lib clang.
All my code is now c++11 based.
I was hoping to be able to access the class initializer nodes for member variables such as here:

class Foo
{
  float x = 3.1415; // want to access the 3.1415 attached to the FieldDecl node for x
};

I can’t seem to find anything in libclang that will allow that.

I believe the C++ method in clang that I want access to is 

Expr* clang::FieldDecl::getInClassInitializer	(		)	const 

but do not see a way of getting that in libclang. Any way I can do this or is this just a limitation I cannot get around.
Thanks, -Derek

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150224/0ca283c5/attachment.html>


More information about the cfe-dev mailing list