From 8c5212e1770f2cef17e2eee31d9a642233559974 Mon Sep 17 00:00:00 2001 From: Alexandre Mutel Date: Wed, 16 Oct 2024 08:46:39 +0200 Subject: [PATCH] Upgrade clang to 18.1.0 --- readme.md | 2 +- src/CppAst.Tests/CppAst.Tests.csproj | 6 +++--- src/CppAst/CppAst.csproj | 6 +++--- src/CppAst/CppModelBuilder.cs | 10 ++++++++++ 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index b6021c3..f6f7b8e 100644 --- a/readme.md +++ b/readme.md @@ -12,7 +12,7 @@ CppAst provides a C/C++ parser for header files with access to the full AST, com - Compatible with `net8.0` - For `netstandard2.0` use `0.14.0` version. -- Using `Clang/libclang 17.0.1` +- Using `Clang/libclang 18.1.0` - Allow to parse *in-memory* C/C++ text and C/C++ files from the disk - Simple AST model - Full type system diff --git a/src/CppAst.Tests/CppAst.Tests.csproj b/src/CppAst.Tests/CppAst.Tests.csproj index dd40d9f..5f04340 100644 --- a/src/CppAst.Tests/CppAst.Tests.csproj +++ b/src/CppAst.Tests/CppAst.Tests.csproj @@ -26,12 +26,12 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/CppAst/CppAst.csproj b/src/CppAst/CppAst.csproj index 1f28542..bf52bbf 100644 --- a/src/CppAst/CppAst.csproj +++ b/src/CppAst/CppAst.csproj @@ -27,12 +27,12 @@ - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CppAst/CppModelBuilder.cs b/src/CppAst/CppModelBuilder.cs index c1555c4..2e8c984 100644 --- a/src/CppAst/CppModelBuilder.cs +++ b/src/CppAst/CppModelBuilder.cs @@ -86,6 +86,11 @@ private CppType TryToCreateTemplateParameters(CXCursor cursor, void* data) private CppContainerContext GetOrCreateDeclarationContainer(CXCursor cursor, void* data) { + while (cursor.Kind == CXCursorKind.CXCursor_LinkageSpec) + { + cursor = cursor.SemanticParent; + } + var typeAsCString = CXUtil.GetCursorUsrString(cursor); if (string.IsNullOrEmpty(typeAsCString)) { @@ -427,6 +432,11 @@ private CXChildVisitResult VisitMember(CXCursor cursor, CXCursor parent, void* d case CXCursorKind.CXCursor_AnnotateAttr: // Don't emit warning break; + + case CXCursorKind.CXCursor_LinkageSpec: + cursor.VisitChildren(VisitMember, new CXClientData((IntPtr)data)); + break; + default: WarningUnhandled(cursor, parent); break;