Bug ID: 30674
           Summary: [libtooling] ASTContext::getObjCInstanceType never
                    returns null - it creates typedef if type is not known
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
    Classification: Unclassified

Docs for getObjCInstanceType say:
"Retrieve the Objective-C "instancetype" type, if already known;
otherwise, returns a NULL type;"

This is obviously not true, by looking at source code, I also tested it on
clang trunk from August to confirm. It would be great if there was a way to
know if getObjCInstanceType is known or not without creating it.

This is how source code looks like:
QualType getObjCInstanceType() {
  return getTypeDeclType(getObjCInstanceTypeDecl());

TypedefDecl *getObjCInstanceTypeDecl() {
  if (!ObjCInstanceTypeDecl)
    ObjCInstanceTypeDecl = TypedefDecl::Create(...)
  return ObjCInstanceTypeDecl;

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to