]> granicus.if.org Git - clang/commit
[libclang] Fix the type of 'int (Foo);'
authorShoaib Meenai <smeenai@fb.com>
Tue, 1 May 2018 20:45:25 +0000 (20:45 +0000)
committerShoaib Meenai <smeenai@fb.com>
Tue, 1 May 2018 20:45:25 +0000 (20:45 +0000)
commitaec83b75b754818ec4c59784b39f7fc60bc43d54
tree8cd061f0e23479b9d423576f3abb5c869108d325
parentabedeb9109266238ab0a7546bfc4c298e32227a5
[libclang] Fix the type of 'int (Foo);'

libclang exposes the type of 'int (Foo);' (a global variable of type int
called Foo) as CXType_Unexposed. This is because Clang represents Foo's
type as ParenType{BuiltinType{Int}}, and libclang does not handle
ParenType.

Make libclang return CXType_Int as the type of 'int (Foo);' by
unwrapping ParenType transparently.

Patch by Matt Glazar.

Differential Revision: https://reviews.llvm.org/D45713

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331306 91177308-0d34-0410-b5e6-96231b3b80d8
test/Index/paren-type.c [new file with mode: 0644]
test/Index/print-type.c
tools/libclang/CXType.cpp