[llvm-bugs] [Bug 28436] New: libclang: namespace missing for typedefs in clang_getTypeSpelling

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 6 09:24:50 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28436

            Bug ID: 28436
           Summary: libclang: namespace missing for typedefs in
                    clang_getTypeSpelling
           Product: new-bugs
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: redm at gmx.de
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Hi

I'm using libclang to parse header files and generate code from them. I found
that clang_getTypeSpelling() usually includes the namespace a type was declared
in. However with the exception being typedefs. This is IMHO at least
inconsistent, and requires me to workaround and figure out the namespaces on my
own.

Minimal example:

namespace foo {
class Bar {
};
typedef Bar BarDef;
}

clang_getTypeSpelling on "Bar" (kind "Record") gives: "foo::Bar"
clang_getTypeSpelling on "BarDef" (kind "Typedef") gives: "BarDef" (<== missing
"foo::")

Would be nice if clang_getTypeSpelling on typedefs would behave like in all
other cases.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160706/21c428ca/attachment.html>


More information about the llvm-bugs mailing list