Skip to content

Commit a1756f3

Browse files
committed
Clang import; Function declaration
1 parent f986b37 commit a1756f3

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

lib/clangimport.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,8 @@ const ::Type * clangimport::AstNode::addTypeTokens(TokenList *tokenList, const s
515515
type.erase(type.find("(*)("));
516516
type += "*";
517517
}
518+
if (type.find("(") != std::string::npos)
519+
type.erase(type.find("("));
518520

519521
std::stack<Token *> lpar;
520522
for (const std::string &s: splitString(type)) {

test/testclangimport.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ class TestClangImport: public TestFixture {
8181
TEST_CASE(funcdecl3);
8282
TEST_CASE(funcdecl4);
8383
TEST_CASE(funcdecl5);
84+
TEST_CASE(funcdecl6);
8485
TEST_CASE(functionTemplateDecl1);
8586
TEST_CASE(functionTemplateDecl2);
8687
TEST_CASE(initListExpr);
@@ -764,6 +765,12 @@ class TestClangImport: public TestFixture {
764765
ASSERT_EQUALS("static inline void foo ( ) ;", parse(clang));
765766
}
766767

768+
void funcdecl6() {
769+
const char clang[] = "`-FunctionDecl 0x196eea8 <1.cpp:3:5, col:27> col:12 foo 'void **(int)'\n"
770+
" `-ParmVarDecl 0x196eda0 <col:17, col:21> col:21 count 'int'";
771+
ASSERT_EQUALS("void * * foo ( int count@1 ) ;", parse(clang));
772+
}
773+
767774
void functionTemplateDecl1() {
768775
const char clang[] = "`-FunctionTemplateDecl 0x3242860 <a.cpp:1:1, col:46> col:21 foo";
769776
ASSERT_EQUALS("", parse(clang));

0 commit comments

Comments
 (0)