[llvm] [llvm] Fixed ItaniumDemangle.h compiled by MSVC (PR #137409)
Dmitry Vasilyev via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 25 15:28:40 PDT 2025
https://github.com/slydiman created https://github.com/llvm/llvm-project/pull/137409
If the includes tree is big enough, `llvm::itanium_demangle::PointerType` may conflict with `llvm::PointerType` from other headers. This patch fixes the following [error](https://lab.llvm.org/buildbot/#/builders/141/builds/8206):
```
C:\lldb-aarch64-windows\llvm-project\llvm\include\llvm/Demangle/ItaniumDemangle.h(617,16): warning: unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier [-Wmicrosoft-unqualified-friend]
617 | friend class PointerType;
| ^
| ::llvm::
C:\lldb-aarch64-windows\llvm-project\llvm\include\llvm/Demangle/ItaniumDemangle.h(667,24): error: 'Protocol' is a private member of 'llvm::itanium_demangle::ObjCProtoName'
667 | OB += objcProto->Protocol;
| ^
C:\lldb-aarch64-windows\llvm-project\llvm\include\llvm/Demangle/ItaniumDemangle.h(615,20): note: implicitly declared private here
615 | std::string_view Protocol;
```
Few buildbots broken by #131836 must be green after this patch.
>From 2a1d7e5ddda5d4505253b9a889ccd3122ec0242b Mon Sep 17 00:00:00 2001
From: Dmitry Vasilyev <dvassiliev at accesssoftek.com>
Date: Sat, 26 Apr 2025 02:24:25 +0400
Subject: [PATCH] [llvm] Fixed ItaniumDemangle.h compiled by MSVC
If the includes tree is big enough, `llvm::itanium_demangle::PointerType` may conflict with `llvm::PointerType` from other headers.
This patch fixes the following [error](https://lab.llvm.org/buildbot/#/builders/141/builds/8206):
```
C:\lldb-aarch64-windows\llvm-project\llvm\include\llvm/Demangle/ItaniumDemangle.h(617,16): warning: unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier [-Wmicrosoft-unqualified-friend]
617 | friend class PointerType;
| ^
| ::llvm::
C:\lldb-aarch64-windows\llvm-project\llvm\include\llvm/Demangle/ItaniumDemangle.h(667,24): error: 'Protocol' is a private member of 'llvm::itanium_demangle::ObjCProtoName'
667 | OB += objcProto->Protocol;
| ^
C:\lldb-aarch64-windows\llvm-project\llvm\include\llvm/Demangle/ItaniumDemangle.h(615,20): note: implicitly declared private here
615 | std::string_view Protocol;
```
---
llvm/include/llvm/Demangle/ItaniumDemangle.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/llvm/include/llvm/Demangle/ItaniumDemangle.h b/llvm/include/llvm/Demangle/ItaniumDemangle.h
index b4a4c72021fd1..f37905971a833 100644
--- a/llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ b/llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -610,6 +610,8 @@ class EnableIfAttr : public Node {
}
};
+class PointerType;
+
class ObjCProtoName : public Node {
const Node *Ty;
std::string_view Protocol;
More information about the llvm-commits
mailing list