[llvm] [DebugInfo][NFC] Fix PDB/Native/LinePrinter.h build warning -Wmicrosoft-unqualified-friend (PR #209715)

Wenju He via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 03:01:25 PDT 2026


https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/209715

Fix build warning on Windows, which is error under -Werror: unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier [-Wmicrosoft-unqualified-friend]

>From ef1d1b46e3d19749b458e015410b29eca736a930 Mon Sep 17 00:00:00 2001
From: Wenju He <wenju.he at intel.com>
Date: Wed, 15 Jul 2026 11:45:04 +0200
Subject: [PATCH] [DebugInfo][NFC] Fix PDB/Native/LinePrinter.h build warning
 -Wmicrosoft-unqualified-friend

Fix build warning on Windows, which is error under -Werror:
unqualified friend declaration referring to type outside of the nearest
enclosing namespace is a Microsoft extension; add a nested name specifier
[-Wmicrosoft-unqualified-friend]
---
 llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h b/llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h
index 95293ba0818d5..bf77a3d19d9d4 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h
@@ -47,9 +47,10 @@ namespace pdb {
 class ClassLayout;
 class PDBFile;
 class SymbolGroup;
+class WithColor;
 
 class LinePrinter {
-  friend class WithColor;
+  friend class pdb::WithColor;
 
 public:
   LLVM_ABI LinePrinter(int Indent, bool UseColor, raw_ostream &Stream,



More information about the llvm-commits mailing list