From c26e205e299e85cf42a04430440b2452e5002b3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 29 Nov 2021 06:59:52 +0100 Subject: [PATCH] clang import: fixed problem with nameless struct --- lib/clangimport.cpp | 2 ++ test/testclangimport.cpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/clangimport.cpp b/lib/clangimport.cpp index d4b2ee2df..d176fed95 100644 --- a/lib/clangimport.cpp +++ b/lib/clangimport.cpp @@ -402,6 +402,8 @@ std::string clangimport::AstNode::getSpelling() const return ""; if (str.compare(0,8," col:7 x 'int'\n" " `-FieldDecl 0x354ebe8 col:7 y 'int'"; @@ -889,6 +890,13 @@ private: parse(clang)); } + void recordDecl2() { + const char clang[] = "`-RecordDecl 0x3befac8 <2.c:2:1, col:22> col:1 struct definition\n" + " `-FieldDecl 0x3befbf0 col:14 val 'int'"; + ASSERT_EQUALS("struct { int val@1 ; } ;", + parse(clang)); + } + void switchStmt() { const char clang[] = "`-FunctionDecl 0x2796ba0 <1.c:1:1, col:35> col:6 foo 'void (int)'\n" " |-ParmVarDecl 0x2796ae0 col:14 used x 'int'\n"