Skip to content

Commit 9c2f62c

Browse files
committed
Fixed a crash when parsing unnamed declarations in name-spaces.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent cacfeaa commit 9c2f62c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/CppParser/Parser.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3811,8 +3811,7 @@ Declaration* Parser::WalkDeclaration(const clang::Decl* D)
38113811

38123812
for (auto D : ND->decls())
38133813
{
3814-
auto ND = dyn_cast<NamedDecl>(D);
3815-
if (IsSupported(ND))
3814+
if (!isa<NamedDecl>(D) || IsSupported(cast<NamedDecl>(D)))
38163815
Decl = WalkDeclarationDef(D);
38173816
}
38183817

tests/Common/Common.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,3 +1412,9 @@ struct TemplateWithUsingTemplateMember
14121412
UsingTemplatePtr<TemplateWithUsingTemplateMember> _Ref;
14131413
};
14141414

1415+
namespace hasUnnamedDecl
1416+
{
1417+
extern "C"
1418+
{
1419+
}
1420+
}

0 commit comments

Comments
 (0)