[cfe-dev] CXXRecordDecl Name

Daniel Dilts diltsman at gmail.com
Mon Jun 30 15:21:59 PDT 2014


I am attempting to get the name of a CXXRecordDecl that I have identified
with an AST matcher.  I am using Class->getName().str() to get the class
name.

namespace N {
class SomeNonInterface {
  virtual void func1() = 0;
  virtual void func2() {}
};
}

It works great for the above code.  Gives me "SomeNonInterface" as the name.

class N::BaseClass1 {
public:
  BaseClass1(int i);
  BaseClass1(const BaseClass1 &right);
  virtual ~BaseClass1();
  BaseClass1 &operator=(const BaseClass1 &right);
};

For the above code it gives me "" as the name.

How would I get the class name so that it works in all cases, even if the
name in the declaration/definition is namespace qualified?  Or...did I hit
a case that isn't legal?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140630/423af49d/attachment.html>


More information about the cfe-dev mailing list