[clang] [Cygwin] Enable TLS on Cygwin target (PR #138618)

2025-05-05 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya created 
https://github.com/llvm/llvm-project/pull/138618

Cygwin environment and toolchain supports EMUTLS.

>From 
>https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=config/tls.m4;hb=HEAD#l118,

```
$ LANG=C gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/15/lto-wrapper.exe Target: 
x86_64-pc-cygwin
Configured with: (snip)
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.1 20250406 (experimental) (GCC)

$ echo '__thread int a; int b; int main() { return a = b; }' | gcc -S -xc -o- - 
| grep __emutls_get_address
call__emutls_get_address
.def__emutls_get_address;   .scl2;  .type   32; .endef
```

>From de268f7f1d19de21ece1ab4c6b53c008bc33 Mon Sep 17 00:00:00 2001
From: kikairoya 
Date: Sat, 19 Apr 2025 07:00:39 +0900
Subject: [PATCH] [Cygwin] TLS for Cygwin target should be available

Cygwin environment and toolchain supports EMUTLS.

>From 
>https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=config/tls.m4;hb=HEAD#l118,

$ LANG=C gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/15/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: (snip)
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.1 20250406 (experimental) (GCC)

$ echo '__thread int a; int b; int main() { return a = b; }' | \
  gcc -S -xc -o- - | \
  grep __emutls_get_address
call__emutls_get_address
.def__emutls_get_address;   .scl2;  .type   32; .endef
---
 clang/lib/Basic/Targets/X86.h  | 1 -
 clang/test/Driver/emulated-tls.cpp | 6 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Basic/Targets/X86.h b/clang/lib/Basic/Targets/X86.h
index 194f3faef1be3..2f6fb33a7b597 100644
--- a/clang/lib/Basic/Targets/X86.h
+++ b/clang/lib/Basic/Targets/X86.h
@@ -965,7 +965,6 @@ class LLVM_LIBRARY_VISIBILITY CygwinX86_64TargetInfo : 
public X86_64TargetInfo {
   CygwinX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
   : X86_64TargetInfo(Triple, Opts) {
 this->WCharType = TargetInfo::UnsignedShort;
-TLSSupported = false;
   }
 
   void getTargetDefines(const LangOptions &Opts,
diff --git a/clang/test/Driver/emulated-tls.cpp 
b/clang/test/Driver/emulated-tls.cpp
index 3ee901a835858..431105bdfdf45 100644
--- a/clang/test/Driver/emulated-tls.cpp
+++ b/clang/test/Driver/emulated-tls.cpp
@@ -8,6 +8,8 @@
 // RUN:   | FileCheck -check-prefix=NOEMU %s
 // RUN: %clang -### --target=i686-pc-cygwin %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=EMU %s
+// RUN: %clang -### --target=x86_64-pc-cygwin %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=EMU %s
 // RUN: %clang -### --target=i686-pc-openbsd %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=EMU %s
 
@@ -17,6 +19,8 @@
 // RUN: | FileCheck -check-prefix=EMU %s
 // RUN: %clang -### -target i686-pc-cygwin %s -fno-emulated-tls -femulated-tls 
2>&1 \
 // RUN: | FileCheck -check-prefix=EMU %s
+// RUN: %clang -### -target x86_64-pc-cygwin %s -fno-emulated-tls 
-femulated-tls 2>&1 \
+// RUN: | FileCheck -check-prefix=EMU %s
 // RUN: %clang -### -target i686-pc-openbsd %s -fno-emulated-tls 
-femulated-tls 2>&1 \
 // RUN: | FileCheck -check-prefix=EMU %s
 
@@ -26,6 +30,8 @@
 // RUN: | FileCheck -check-prefix=NOEMU %s
 // RUN: %clang -### -target i686-pc-cygwin %s -femulated-tls -fno-emulated-tls 
2>&1 \
 // RUN: | FileCheck -check-prefix=NOEMU %s
+// RUN: %clang -### -target x86_64-pc-cygwin %s -femulated-tls 
-fno-emulated-tls 2>&1 \
+// RUN: | FileCheck -check-prefix=NOEMU %s
 // RUN: %clang -### -target i686-pc-openbsd %s -femulated-tls 
-fno-emulated-tls 2>&1 \
 // RUN: | FileCheck -check-prefix=NOEMU %s
 

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Cygwin] Global symbols should be external by default (PR #139797)

2025-05-13 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya created 
https://github.com/llvm/llvm-project/pull/139797

Behaves as same as both of Clang and GCC targetting MinGW. Required for 
compatibility for Cygwin-GCC.

Divided from https://github.com/llvm/llvm-project/pull/138773


>From 8bb0b61112d68f6cecbc15411f5080c413a494a3 Mon Sep 17 00:00:00 2001
From: kikairoya 
Date: Sat, 19 Apr 2025 16:06:37 +0900
Subject: [PATCH] [Cygwin] Global symbols should be external by default

Behaves as same as both of Clang and GCC targetting MinGW.
Required for compatibility for Cygwin-GCC.
---
 clang/lib/CodeGen/CodeGenModule.cpp   |   2 +-
 clang/test/CodeGen/dllexport.c|   2 +
 clang/test/CodeGen/dllimport.c|   3 +
 clang/test/CodeGen/dso-local-executable.c |   3 +
 clang/test/CodeGenCXX/dllexport.cpp   |  30 -
 clang/test/CodeGenCXX/dllimport-members.cpp   | 104 +-
 clang/test/CodeGenCXX/dllimport.cpp   |  30 -
 .../test/CodeGenCXX/dso-local-executable.cpp  |   1 +
 8 files changed, 164 insertions(+), 11 deletions(-)

diff --git a/clang/lib/CodeGen/CodeGenModule.cpp 
b/clang/lib/CodeGen/CodeGenModule.cpp
index 50041f883cfe5..16e010adbeb5f 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1689,7 +1689,7 @@ static bool shouldAssumeDSOLocal(const CodeGenModule &CGM,
 
   const llvm::Triple &TT = CGM.getTriple();
   const auto &CGOpts = CGM.getCodeGenOpts();
-  if (TT.isWindowsGNUEnvironment()) {
+  if (TT.isOSCygMing()) {
 // In MinGW, variables without DLLImport can still be automatically
 // imported from a DLL by the linker; don't mark variables that
 // potentially could come from another DLL as DSO local.
diff --git a/clang/test/CodeGen/dllexport.c b/clang/test/CodeGen/dllexport.c
index 4c1143cf5ca48..f64bcb5393005 100644
--- a/clang/test/CodeGen/dllexport.c
+++ b/clang/test/CodeGen/dllexport.c
@@ -2,6 +2,8 @@
 // RUN: %clang_cc1 -triple x86_64-windows-msvc -fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck %s
 // RUN: %clang_cc1 -triple i686-windows-gnu-fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-windows-gnu  -fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i686-pc-cygwin  -fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-pc-cygwin-fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck %s
 
 
 
diff --git a/clang/test/CodeGen/dllimport.c b/clang/test/CodeGen/dllimport.c
index 6170c8c4a66a3..1631c6dc56805 100644
--- a/clang/test/CodeGen/dllimport.c
+++ b/clang/test/CodeGen/dllimport.c
@@ -2,8 +2,11 @@
 // RUN: %clang_cc1 -triple x86_64-windows-msvc -fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck --check-prefix=CHECK --check-prefix=MS %s
 // RUN: %clang_cc1 -triple i686-windows-gnu-fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck --check-prefix=CHECK --check-prefix=GNU %s
 // RUN: %clang_cc1 -triple x86_64-windows-gnu  -fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck --check-prefix=CHECK --check-prefix=GNU %s
+// RUN: %clang_cc1 -triple i686-pc-cygwin  -fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck --check-prefix=CHECK --check-prefix=GNU %s
+// RUN: %clang_cc1 -triple x86_64-pc-cygwin-fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck --check-prefix=CHECK --check-prefix=GNU %s
 // RUN: %clang_cc1 -triple i686-windows-msvc   -fms-extensions -emit-llvm 
-std=c11 -O1 -fno-inline -o - %s | FileCheck --check-prefix=O1 
--check-prefix=MO1 %s
 // RUN: %clang_cc1 -triple i686-windows-gnu-fms-extensions -emit-llvm 
-std=c11 -O1 -fno-inline -o - %s | FileCheck --check-prefix=O1 
--check-prefix=GO1 %s
+// RUN: %clang_cc1 -triple i686-pc-cygwin  -fms-extensions -emit-llvm 
-std=c11 -O1 -fno-inline -o - %s | FileCheck --check-prefix=O1 
--check-prefix=GO1 %s
 
 #define JOIN2(x, y) x##y
 #define JOIN(x, y) JOIN2(x, y)
diff --git a/clang/test/CodeGen/dso-local-executable.c 
b/clang/test/CodeGen/dso-local-executable.c
index 15575d3927f23..880273df137d7 100644
--- a/clang/test/CodeGen/dso-local-executable.c
+++ b/clang/test/CodeGen/dso-local-executable.c
@@ -12,6 +12,9 @@
 // RUN: %clang_cc1 -triple x86_64-w64-mingw32 -emit-llvm %s -o - | FileCheck 
--check-prefixes=MINGW,MINGW-NATIVE_TLS,MINGW-AUTO-IMPORT %s
 // RUN: %clang_cc1 -triple x86_64-w64-mingw32 -emit-llvm %s -o - 
-fno-auto-import | FileCheck 
--check-prefixes=MINGW,MINGW-NATIVE_TLS,MINGW-NO-AUTO-IMPORT %s
 // RUN: %clang_cc1 -triple x86_64-w64-mingw32 -emit-llvm %s -o - 
-femulated-tls | FileCheck 
--check-prefixes=MINGW,MINGW-EMUTLS,MINGW-AUTO-IMPORT %s
+// RUN: %clang_cc1 -triple x86_64-pc-cygwin   -emit-llvm %s -o - | FileCheck 
--check-prefixes=MINGW,MINGW-NATIVE_TLS,MINGW-AUTO-IMPORT %s
+// RUN: %clang_cc1 -triple x86_64-pc-cygwin   -emit-llvm %s -o - 
-fno-auto-import | FileCheck 
--check-prefixes=MINGW,

[clang] [Cygwin] RTTI and VTable should be dllexport-ed (PR #139798)

2025-05-13 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya created 
https://github.com/llvm/llvm-project/pull/139798

Behaves as same as both of Clang and GCC targetting MinGW. Required for 
compatibility for Cygwin-GCC.

Divided from https://github.com/llvm/llvm-project/pull/138773




  



Rate limit · GitHub


  body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe 
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
  }

  .container { margin: 50px auto; max-width: 600px; text-align: center; 
padding: 0 24px; }

  a { color: #0366d6; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px; 
text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  



  Whoa there!
  You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
  
  
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
  

  

  

  

  

  


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Cygwin] Template instantiations should be exported by default (PR #139799)

2025-05-13 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya edited 
https://github.com/llvm/llvm-project/pull/139799
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Cygwin] Export global symbols, template instantiations, RTTI and VTable are exported correctly (PR #138773)

2025-05-13 Thread Tomohiro Kashiwada via cfe-commits

kikairoya wrote:

Thank you. I have divided into separated PRs. They don't have conflict each.

https://github.com/llvm/llvm-project/pull/139797
https://github.com/llvm/llvm-project/pull/139798
https://github.com/llvm/llvm-project/pull/139799



https://github.com/llvm/llvm-project/pull/138773
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Cygwin] Template instantiations should be exported by default (PR #139799)

2025-05-13 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya created 
https://github.com/llvm/llvm-project/pull/139799

Behaves as same as both of Clang and GCC targetting MinGW. Required for 
compatibility for Cygwin-GCC.

https://github.com/llvm/llvm-project/pull/138773




  



Rate limit · GitHub


  body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe 
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
  }

  .container { margin: 50px auto; max-width: 600px; text-align: center; 
padding: 0 24px; }

  a { color: #0366d6; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px; 
text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  



  Whoa there!
  You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
  
  
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
  

  

  

  

  

  


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Cygwin] Export global symbols, template instantiations, RTTI and VTable are exported correctly (PR #138773)

2025-05-06 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya created 
https://github.com/llvm/llvm-project/pull/138773

MinGW-GCC and MinGW-Clang exports these symbols.
Cygwin-GCC also exports them, so Cygwin-Clang should do so.

Some of tests have new DAG pattern because i686-cygwin don't use __thiscall but 
__cdecl for member functions.

This is a prerequisite for resolve 
https://github.com/llvm/llvm-project/issues/135910 .



  



Rate limit · GitHub


  body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe 
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
  }

  .container { margin: 50px auto; max-width: 600px; text-align: center; 
padding: 0 24px; }

  a { color: #0366d6; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px; 
text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  



  Whoa there!
  You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
  
  
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
  

  

  

  

  

  


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Cygwin] Export global symbols, template instantiations, RTTI and VTable are exported correctly (PR #138773)

2025-05-06 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya edited 
https://github.com/llvm/llvm-project/pull/138773
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-16 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya updated 
https://github.com/llvm/llvm-project/pull/140145

>From 827e89b8148e7eaa69bbae342cfb2a59d1b09133 Mon Sep 17 00:00:00 2001
From: kikairoya 
Date: Mon, 21 Apr 2025 23:30:13 +0900
Subject: [PATCH 1/2] [Cygwin][MinGW] Internal class in
 explicitly-instantiation-declarated template should be instantiated

In-code comment says "explicit instantiation decl of the outer class
doesn't affect the inner class" but this behavior seems MSVC
specific, MinGW-GCC and Cygwin-GCC does not.
Clang should honor gcc's behavior.

This change fixes std::string compatibilty and resolves strange link
error (statically linked), strange crash (dynamically linked) using
libstdc++ on Cygwin.
---
 clang/lib/Sema/SemaTemplateInstantiate.cpp|   1 +
 .../CodeGenCXX/mingw-template-dllexport.cpp   | 109 +++---
 2 files changed, 93 insertions(+), 17 deletions(-)

diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp 
b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index d028eea4f8f3e..b7c27b3795f5d 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -4247,6 +4247,7 @@ Sema::InstantiateClassMembers(SourceLocation 
PointOfInstantiation,
 continue;
 
   if (Context.getTargetInfo().getTriple().isOSWindows() &&
+  !Context.getTargetInfo().getTriple().isOSCygMing() &&
   TSK == TSK_ExplicitInstantiationDeclaration) {
 // On Windows, explicit instantiation decl of the outer class doesn't
 // affect the inner class. Typically extern template declarations are
diff --git a/clang/test/CodeGenCXX/mingw-template-dllexport.cpp 
b/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
index de112d6da53db..a6047b5955e96 100644
--- a/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
+++ b/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
@@ -6,46 +6,121 @@
 #define JOIN2(x, y) x##y
 #define JOIN(x, y) JOIN2(x, y)
 #define UNIQ(name) JOIN(name, __LINE__)
-#define USEMEMFUNC(class, func) void (class::*UNIQ(use)())() { return 
&class::func; }
+#define USEMEMFUNC(class, func) auto UNIQ(use) = &class::func;
 
 template 
 class c {
+  // MinGW-GCC does not apply 'dllexport' to inline member function in 
dll-exported template but clang does from long ago.
   void f() {}
+  void g();
+  inline static int u = 0;
+  static int v;
 };
+template  void c::g() {}
+template  int c::v = 0;
 
+// #1
 template class __declspec(dllexport) c;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIiE1fEv
-
+// #2
 extern template class __declspec(dllexport) c;
 template class c;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIcE1fEv
-
+// #3
 extern template class c;
-template class __declspec(dllexport) c;
+template class __declspec(dllexport) c; // expected-warning {{ 
'dllexport' attribute ignored on explicit instantiation definition }}
 
-// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN1cIdE1fEv
 
 template 
 struct outer {
-  void f();
+  void f() {}
+  void g();
+  inline static int u = 0;
+  static int v;
+  // MinGW-GCC and Clang does not apply 'dllexport' to inner type and its 
sub-elements in template class.
   struct inner {
-void f();
+void f() {}
+void g();
+inline static int u = 0;
+static int v;
   };
 };
 
-template  void outer::f() {}
-template  void outer::inner::f() {}
+template  void outer::g() {}
+template  void outer::inner::g() {}
+template  int outer::v = 0;
+template  int outer::inner::v = 0;
 
-template class __declspec(dllexport) outer;
+// #4
+template struct __declspec(dllexport) outer;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN5outerIiE1fEv
-// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN5outerIiE5inner1fEv
-
-extern template class __declspec(dllimport) outer;
+// #5
+extern template struct __declspec(dllimport) outer;
 USEMEMFUNC(outer, f)
+USEMEMFUNC(outer, g)
+USEMEMFUNC(outer, u)
+USEMEMFUNC(outer, v)
 USEMEMFUNC(outer::inner, f)
+USEMEMFUNC(outer::inner, g)
+USEMEMFUNC(outer::inner, u)
+USEMEMFUNC(outer::inner, v)
+
+
+// #1 variables
+// CHECK: @_ZN1cIiE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIiE1vE = {{.*}} dllexport {{.*}}
+
+// #2 variables
+// CHECK: @_ZN1cIcE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIcE1vE = {{.*}} dllexport {{.*}}
+
+// #3 variables
+// CHECK: @_ZN1cIdE1uE = {{.*}}
+// CHECK-NOT: @_ZN1cIcE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIdE1vE = {{.*}}
+// CHECK-NOT: @_ZN1cIcE1vE = {{.*}} dllexport {{.*}}
+
+// #4 variables
+// CHECK: @_ZN5outerIiE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE1vE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE5inner1uE = {{.*}}
+// CHECK-NOT: @_ZN5outerIiE5inner1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE5inner1vE = {{.*}}
+// CHECK-NOT: @_ZN5outerIiE5inner1vE = {{.*}} dllexport {{.*}}
+
+// #5 variables
+// CHECK: @_ZN5outerIcE1uE = external dllimport {{.*}}
+// CHECK: @_ZN5outerIcE1vE = external dllimport {{.*}}
+// CHECK-NOT: @_ZN5outerIcE5inner1uE = dllimport {{.*}}
+// CHECK-N

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-16 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya updated 
https://github.com/llvm/llvm-project/pull/140145

>From 827e89b8148e7eaa69bbae342cfb2a59d1b09133 Mon Sep 17 00:00:00 2001
From: kikairoya 
Date: Mon, 21 Apr 2025 23:30:13 +0900
Subject: [PATCH 1/3] [Cygwin][MinGW] Internal class in
 explicitly-instantiation-declarated template should be instantiated

In-code comment says "explicit instantiation decl of the outer class
doesn't affect the inner class" but this behavior seems MSVC
specific, MinGW-GCC and Cygwin-GCC does not.
Clang should honor gcc's behavior.

This change fixes std::string compatibilty and resolves strange link
error (statically linked), strange crash (dynamically linked) using
libstdc++ on Cygwin.
---
 clang/lib/Sema/SemaTemplateInstantiate.cpp|   1 +
 .../CodeGenCXX/mingw-template-dllexport.cpp   | 109 +++---
 2 files changed, 93 insertions(+), 17 deletions(-)

diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp 
b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index d028eea4f8f3e..b7c27b3795f5d 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -4247,6 +4247,7 @@ Sema::InstantiateClassMembers(SourceLocation 
PointOfInstantiation,
 continue;
 
   if (Context.getTargetInfo().getTriple().isOSWindows() &&
+  !Context.getTargetInfo().getTriple().isOSCygMing() &&
   TSK == TSK_ExplicitInstantiationDeclaration) {
 // On Windows, explicit instantiation decl of the outer class doesn't
 // affect the inner class. Typically extern template declarations are
diff --git a/clang/test/CodeGenCXX/mingw-template-dllexport.cpp 
b/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
index de112d6da53db..a6047b5955e96 100644
--- a/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
+++ b/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
@@ -6,46 +6,121 @@
 #define JOIN2(x, y) x##y
 #define JOIN(x, y) JOIN2(x, y)
 #define UNIQ(name) JOIN(name, __LINE__)
-#define USEMEMFUNC(class, func) void (class::*UNIQ(use)())() { return 
&class::func; }
+#define USEMEMFUNC(class, func) auto UNIQ(use) = &class::func;
 
 template 
 class c {
+  // MinGW-GCC does not apply 'dllexport' to inline member function in 
dll-exported template but clang does from long ago.
   void f() {}
+  void g();
+  inline static int u = 0;
+  static int v;
 };
+template  void c::g() {}
+template  int c::v = 0;
 
+// #1
 template class __declspec(dllexport) c;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIiE1fEv
-
+// #2
 extern template class __declspec(dllexport) c;
 template class c;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIcE1fEv
-
+// #3
 extern template class c;
-template class __declspec(dllexport) c;
+template class __declspec(dllexport) c; // expected-warning {{ 
'dllexport' attribute ignored on explicit instantiation definition }}
 
-// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN1cIdE1fEv
 
 template 
 struct outer {
-  void f();
+  void f() {}
+  void g();
+  inline static int u = 0;
+  static int v;
+  // MinGW-GCC and Clang does not apply 'dllexport' to inner type and its 
sub-elements in template class.
   struct inner {
-void f();
+void f() {}
+void g();
+inline static int u = 0;
+static int v;
   };
 };
 
-template  void outer::f() {}
-template  void outer::inner::f() {}
+template  void outer::g() {}
+template  void outer::inner::g() {}
+template  int outer::v = 0;
+template  int outer::inner::v = 0;
 
-template class __declspec(dllexport) outer;
+// #4
+template struct __declspec(dllexport) outer;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN5outerIiE1fEv
-// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN5outerIiE5inner1fEv
-
-extern template class __declspec(dllimport) outer;
+// #5
+extern template struct __declspec(dllimport) outer;
 USEMEMFUNC(outer, f)
+USEMEMFUNC(outer, g)
+USEMEMFUNC(outer, u)
+USEMEMFUNC(outer, v)
 USEMEMFUNC(outer::inner, f)
+USEMEMFUNC(outer::inner, g)
+USEMEMFUNC(outer::inner, u)
+USEMEMFUNC(outer::inner, v)
+
+
+// #1 variables
+// CHECK: @_ZN1cIiE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIiE1vE = {{.*}} dllexport {{.*}}
+
+// #2 variables
+// CHECK: @_ZN1cIcE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIcE1vE = {{.*}} dllexport {{.*}}
+
+// #3 variables
+// CHECK: @_ZN1cIdE1uE = {{.*}}
+// CHECK-NOT: @_ZN1cIcE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIdE1vE = {{.*}}
+// CHECK-NOT: @_ZN1cIcE1vE = {{.*}} dllexport {{.*}}
+
+// #4 variables
+// CHECK: @_ZN5outerIiE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE1vE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE5inner1uE = {{.*}}
+// CHECK-NOT: @_ZN5outerIiE5inner1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE5inner1vE = {{.*}}
+// CHECK-NOT: @_ZN5outerIiE5inner1vE = {{.*}} dllexport {{.*}}
+
+// #5 variables
+// CHECK: @_ZN5outerIcE1uE = external dllimport {{.*}}
+// CHECK: @_ZN5outerIcE1vE = external dllimport {{.*}}
+// CHECK-NOT: @_ZN5outerIcE5inner1uE = dllimport {{.*}}
+// CHECK-N

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-16 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya updated 
https://github.com/llvm/llvm-project/pull/140145

>From 47f81a804a36a5b685f130f22d2ab5d330170861 Mon Sep 17 00:00:00 2001
From: kikairoya 
Date: Mon, 21 Apr 2025 23:30:13 +0900
Subject: [PATCH 1/2] [Cygwin][MinGW] Internal class in
 explicitly-instantiation-declarated template should be instantiated

In-code comment says "explicit instantiation decl of the outer class
doesn't affect the inner class" but this behavior seems MSVC
specific, MinGW-GCC and Cygwin-GCC does not.
Clang should honor gcc's behavior.

This change fixes std::string compatibilty and resolves strange link
error (statically linked), strange crash (dynamically linked) using
libstdc++ on Cygwin.
---
 clang/lib/Sema/SemaTemplateInstantiate.cpp|   1 +
 .../CodeGenCXX/mingw-template-dllexport.cpp   | 109 +++---
 2 files changed, 93 insertions(+), 17 deletions(-)

diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp 
b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index d028eea4f8f3e..b7c27b3795f5d 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -4247,6 +4247,7 @@ Sema::InstantiateClassMembers(SourceLocation 
PointOfInstantiation,
 continue;
 
   if (Context.getTargetInfo().getTriple().isOSWindows() &&
+  !Context.getTargetInfo().getTriple().isOSCygMing() &&
   TSK == TSK_ExplicitInstantiationDeclaration) {
 // On Windows, explicit instantiation decl of the outer class doesn't
 // affect the inner class. Typically extern template declarations are
diff --git a/clang/test/CodeGenCXX/mingw-template-dllexport.cpp 
b/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
index de112d6da53db..a6047b5955e96 100644
--- a/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
+++ b/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
@@ -6,46 +6,121 @@
 #define JOIN2(x, y) x##y
 #define JOIN(x, y) JOIN2(x, y)
 #define UNIQ(name) JOIN(name, __LINE__)
-#define USEMEMFUNC(class, func) void (class::*UNIQ(use)())() { return 
&class::func; }
+#define USEMEMFUNC(class, func) auto UNIQ(use) = &class::func;
 
 template 
 class c {
+  // MinGW-GCC does not apply 'dllexport' to inline member function in 
dll-exported template but clang does from long ago.
   void f() {}
+  void g();
+  inline static int u = 0;
+  static int v;
 };
+template  void c::g() {}
+template  int c::v = 0;
 
+// #1
 template class __declspec(dllexport) c;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIiE1fEv
-
+// #2
 extern template class __declspec(dllexport) c;
 template class c;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIcE1fEv
-
+// #3
 extern template class c;
-template class __declspec(dllexport) c;
+template class __declspec(dllexport) c; // expected-warning {{ 
'dllexport' attribute ignored on explicit instantiation definition }}
 
-// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN1cIdE1fEv
 
 template 
 struct outer {
-  void f();
+  void f() {}
+  void g();
+  inline static int u = 0;
+  static int v;
+  // MinGW-GCC and Clang does not apply 'dllexport' to inner type and its 
sub-elements in template class.
   struct inner {
-void f();
+void f() {}
+void g();
+inline static int u = 0;
+static int v;
   };
 };
 
-template  void outer::f() {}
-template  void outer::inner::f() {}
+template  void outer::g() {}
+template  void outer::inner::g() {}
+template  int outer::v = 0;
+template  int outer::inner::v = 0;
 
-template class __declspec(dllexport) outer;
+// #4
+template struct __declspec(dllexport) outer;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN5outerIiE1fEv
-// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN5outerIiE5inner1fEv
-
-extern template class __declspec(dllimport) outer;
+// #5
+extern template struct __declspec(dllimport) outer;
 USEMEMFUNC(outer, f)
+USEMEMFUNC(outer, g)
+USEMEMFUNC(outer, u)
+USEMEMFUNC(outer, v)
 USEMEMFUNC(outer::inner, f)
+USEMEMFUNC(outer::inner, g)
+USEMEMFUNC(outer::inner, u)
+USEMEMFUNC(outer::inner, v)
+
+
+// #1 variables
+// CHECK: @_ZN1cIiE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIiE1vE = {{.*}} dllexport {{.*}}
+
+// #2 variables
+// CHECK: @_ZN1cIcE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIcE1vE = {{.*}} dllexport {{.*}}
+
+// #3 variables
+// CHECK: @_ZN1cIdE1uE = {{.*}}
+// CHECK-NOT: @_ZN1cIcE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIdE1vE = {{.*}}
+// CHECK-NOT: @_ZN1cIcE1vE = {{.*}} dllexport {{.*}}
+
+// #4 variables
+// CHECK: @_ZN5outerIiE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE1vE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE5inner1uE = {{.*}}
+// CHECK-NOT: @_ZN5outerIiE5inner1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE5inner1vE = {{.*}}
+// CHECK-NOT: @_ZN5outerIiE5inner1vE = {{.*}} dllexport {{.*}}
+
+// #5 variables
+// CHECK: @_ZN5outerIcE1uE = external dllimport {{.*}}
+// CHECK: @_ZN5outerIcE1vE = external dllimport {{.*}}
+// CHECK-NOT: @_ZN5outerIcE5inner1uE = dllimport {{.*}}
+// CHECK-N

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-16 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya updated 
https://github.com/llvm/llvm-project/pull/140145

>From 47f81a804a36a5b685f130f22d2ab5d330170861 Mon Sep 17 00:00:00 2001
From: kikairoya 
Date: Mon, 21 Apr 2025 23:30:13 +0900
Subject: [PATCH 1/2] [Cygwin][MinGW] Internal class in
 explicitly-instantiation-declarated template should be instantiated

In-code comment says "explicit instantiation decl of the outer class
doesn't affect the inner class" but this behavior seems MSVC
specific, MinGW-GCC and Cygwin-GCC does not.
Clang should honor gcc's behavior.

This change fixes std::string compatibilty and resolves strange link
error (statically linked), strange crash (dynamically linked) using
libstdc++ on Cygwin.
---
 clang/lib/Sema/SemaTemplateInstantiate.cpp|   1 +
 .../CodeGenCXX/mingw-template-dllexport.cpp   | 109 +++---
 2 files changed, 93 insertions(+), 17 deletions(-)

diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp 
b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index d028eea4f8f3e..b7c27b3795f5d 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -4247,6 +4247,7 @@ Sema::InstantiateClassMembers(SourceLocation 
PointOfInstantiation,
 continue;
 
   if (Context.getTargetInfo().getTriple().isOSWindows() &&
+  !Context.getTargetInfo().getTriple().isOSCygMing() &&
   TSK == TSK_ExplicitInstantiationDeclaration) {
 // On Windows, explicit instantiation decl of the outer class doesn't
 // affect the inner class. Typically extern template declarations are
diff --git a/clang/test/CodeGenCXX/mingw-template-dllexport.cpp 
b/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
index de112d6da53db..a6047b5955e96 100644
--- a/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
+++ b/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
@@ -6,46 +6,121 @@
 #define JOIN2(x, y) x##y
 #define JOIN(x, y) JOIN2(x, y)
 #define UNIQ(name) JOIN(name, __LINE__)
-#define USEMEMFUNC(class, func) void (class::*UNIQ(use)())() { return 
&class::func; }
+#define USEMEMFUNC(class, func) auto UNIQ(use) = &class::func;
 
 template 
 class c {
+  // MinGW-GCC does not apply 'dllexport' to inline member function in 
dll-exported template but clang does from long ago.
   void f() {}
+  void g();
+  inline static int u = 0;
+  static int v;
 };
+template  void c::g() {}
+template  int c::v = 0;
 
+// #1
 template class __declspec(dllexport) c;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIiE1fEv
-
+// #2
 extern template class __declspec(dllexport) c;
 template class c;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIcE1fEv
-
+// #3
 extern template class c;
-template class __declspec(dllexport) c;
+template class __declspec(dllexport) c; // expected-warning {{ 
'dllexport' attribute ignored on explicit instantiation definition }}
 
-// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN1cIdE1fEv
 
 template 
 struct outer {
-  void f();
+  void f() {}
+  void g();
+  inline static int u = 0;
+  static int v;
+  // MinGW-GCC and Clang does not apply 'dllexport' to inner type and its 
sub-elements in template class.
   struct inner {
-void f();
+void f() {}
+void g();
+inline static int u = 0;
+static int v;
   };
 };
 
-template  void outer::f() {}
-template  void outer::inner::f() {}
+template  void outer::g() {}
+template  void outer::inner::g() {}
+template  int outer::v = 0;
+template  int outer::inner::v = 0;
 
-template class __declspec(dllexport) outer;
+// #4
+template struct __declspec(dllexport) outer;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN5outerIiE1fEv
-// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN5outerIiE5inner1fEv
-
-extern template class __declspec(dllimport) outer;
+// #5
+extern template struct __declspec(dllimport) outer;
 USEMEMFUNC(outer, f)
+USEMEMFUNC(outer, g)
+USEMEMFUNC(outer, u)
+USEMEMFUNC(outer, v)
 USEMEMFUNC(outer::inner, f)
+USEMEMFUNC(outer::inner, g)
+USEMEMFUNC(outer::inner, u)
+USEMEMFUNC(outer::inner, v)
+
+
+// #1 variables
+// CHECK: @_ZN1cIiE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIiE1vE = {{.*}} dllexport {{.*}}
+
+// #2 variables
+// CHECK: @_ZN1cIcE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIcE1vE = {{.*}} dllexport {{.*}}
+
+// #3 variables
+// CHECK: @_ZN1cIdE1uE = {{.*}}
+// CHECK-NOT: @_ZN1cIcE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIdE1vE = {{.*}}
+// CHECK-NOT: @_ZN1cIcE1vE = {{.*}} dllexport {{.*}}
+
+// #4 variables
+// CHECK: @_ZN5outerIiE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE1vE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE5inner1uE = {{.*}}
+// CHECK-NOT: @_ZN5outerIiE5inner1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE5inner1vE = {{.*}}
+// CHECK-NOT: @_ZN5outerIiE5inner1vE = {{.*}} dllexport {{.*}}
+
+// #5 variables
+// CHECK: @_ZN5outerIcE1uE = external dllimport {{.*}}
+// CHECK: @_ZN5outerIcE1vE = external dllimport {{.*}}
+// CHECK-NOT: @_ZN5outerIcE5inner1uE = dllimport {{.*}}
+// CHECK-N

[clang] [Cygwin] Export global symbols, template instantiations, RTTI and VTable are exported correctly (PR #138773)

2025-05-14 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya closed 
https://github.com/llvm/llvm-project/pull/138773
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Cygwin] Global symbols should be external by default (PR #139797)

2025-05-14 Thread Tomohiro Kashiwada via cfe-commits


@@ -2,6 +2,8 @@
 // RUN: %clang_cc1 -triple x86_64-windows-msvc -fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck %s
 // RUN: %clang_cc1 -triple i686-windows-gnu-fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-windows-gnu  -fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i686-pc-cygwin  -fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-pc-cygwin-fms-extensions -emit-llvm 
-std=c11 -O0 -o - %s | FileCheck %s

kikairoya wrote:

I'm sorry. I will be careful next time.

https://github.com/llvm/llvm-project/pull/139797
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-16 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya updated 
https://github.com/llvm/llvm-project/pull/140145



  



Rate limit · GitHub


  body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe 
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
  }

  .container { margin: 50px auto; max-width: 600px; text-align: center; 
padding: 0 24px; }

  a { color: #0366d6; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px; 
text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  



  Whoa there!
  You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
  
  
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
  

  

  

  

  

  


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-16 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya updated 
https://github.com/llvm/llvm-project/pull/140145



  



Rate limit · GitHub


  body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe 
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
  }

  .container { margin: 50px auto; max-width: 600px; text-align: center; 
padding: 0 24px; }

  a { color: #0366d6; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px; 
text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  



  Whoa there!
  You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
  
  
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
  

  

  

  

  

  


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-16 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya updated 
https://github.com/llvm/llvm-project/pull/140145

>From 827e89b8148e7eaa69bbae342cfb2a59d1b09133 Mon Sep 17 00:00:00 2001
From: kikairoya 
Date: Mon, 21 Apr 2025 23:30:13 +0900
Subject: [PATCH 1/2] [Cygwin][MinGW] Internal class in
 explicitly-instantiation-declarated template should be instantiated

In-code comment says "explicit instantiation decl of the outer class
doesn't affect the inner class" but this behavior seems MSVC
specific, MinGW-GCC and Cygwin-GCC does not.
Clang should honor gcc's behavior.

This change fixes std::string compatibilty and resolves strange link
error (statically linked), strange crash (dynamically linked) using
libstdc++ on Cygwin.
---
 clang/lib/Sema/SemaTemplateInstantiate.cpp|   1 +
 .../CodeGenCXX/mingw-template-dllexport.cpp   | 109 +++---
 2 files changed, 93 insertions(+), 17 deletions(-)

diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp 
b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index d028eea4f8f3e..b7c27b3795f5d 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -4247,6 +4247,7 @@ Sema::InstantiateClassMembers(SourceLocation 
PointOfInstantiation,
 continue;
 
   if (Context.getTargetInfo().getTriple().isOSWindows() &&
+  !Context.getTargetInfo().getTriple().isOSCygMing() &&
   TSK == TSK_ExplicitInstantiationDeclaration) {
 // On Windows, explicit instantiation decl of the outer class doesn't
 // affect the inner class. Typically extern template declarations are
diff --git a/clang/test/CodeGenCXX/mingw-template-dllexport.cpp 
b/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
index de112d6da53db..a6047b5955e96 100644
--- a/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
+++ b/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
@@ -6,46 +6,121 @@
 #define JOIN2(x, y) x##y
 #define JOIN(x, y) JOIN2(x, y)
 #define UNIQ(name) JOIN(name, __LINE__)
-#define USEMEMFUNC(class, func) void (class::*UNIQ(use)())() { return 
&class::func; }
+#define USEMEMFUNC(class, func) auto UNIQ(use) = &class::func;
 
 template 
 class c {
+  // MinGW-GCC does not apply 'dllexport' to inline member function in 
dll-exported template but clang does from long ago.
   void f() {}
+  void g();
+  inline static int u = 0;
+  static int v;
 };
+template  void c::g() {}
+template  int c::v = 0;
 
+// #1
 template class __declspec(dllexport) c;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIiE1fEv
-
+// #2
 extern template class __declspec(dllexport) c;
 template class c;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIcE1fEv
-
+// #3
 extern template class c;
-template class __declspec(dllexport) c;
+template class __declspec(dllexport) c; // expected-warning {{ 
'dllexport' attribute ignored on explicit instantiation definition }}
 
-// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN1cIdE1fEv
 
 template 
 struct outer {
-  void f();
+  void f() {}
+  void g();
+  inline static int u = 0;
+  static int v;
+  // MinGW-GCC and Clang does not apply 'dllexport' to inner type and its 
sub-elements in template class.
   struct inner {
-void f();
+void f() {}
+void g();
+inline static int u = 0;
+static int v;
   };
 };
 
-template  void outer::f() {}
-template  void outer::inner::f() {}
+template  void outer::g() {}
+template  void outer::inner::g() {}
+template  int outer::v = 0;
+template  int outer::inner::v = 0;
 
-template class __declspec(dllexport) outer;
+// #4
+template struct __declspec(dllexport) outer;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN5outerIiE1fEv
-// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN5outerIiE5inner1fEv
-
-extern template class __declspec(dllimport) outer;
+// #5
+extern template struct __declspec(dllimport) outer;
 USEMEMFUNC(outer, f)
+USEMEMFUNC(outer, g)
+USEMEMFUNC(outer, u)
+USEMEMFUNC(outer, v)
 USEMEMFUNC(outer::inner, f)
+USEMEMFUNC(outer::inner, g)
+USEMEMFUNC(outer::inner, u)
+USEMEMFUNC(outer::inner, v)
+
+
+// #1 variables
+// CHECK: @_ZN1cIiE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIiE1vE = {{.*}} dllexport {{.*}}
+
+// #2 variables
+// CHECK: @_ZN1cIcE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIcE1vE = {{.*}} dllexport {{.*}}
+
+// #3 variables
+// CHECK: @_ZN1cIdE1uE = {{.*}}
+// CHECK-NOT: @_ZN1cIcE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIdE1vE = {{.*}}
+// CHECK-NOT: @_ZN1cIcE1vE = {{.*}} dllexport {{.*}}
+
+// #4 variables
+// CHECK: @_ZN5outerIiE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE1vE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE5inner1uE = {{.*}}
+// CHECK-NOT: @_ZN5outerIiE5inner1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE5inner1vE = {{.*}}
+// CHECK-NOT: @_ZN5outerIiE5inner1vE = {{.*}} dllexport {{.*}}
+
+// #5 variables
+// CHECK: @_ZN5outerIcE1uE = external dllimport {{.*}}
+// CHECK: @_ZN5outerIcE1vE = external dllimport {{.*}}
+// CHECK-NOT: @_ZN5outerIcE5inner1uE = dllimport {{.*}}
+// CHECK-N

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-17 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya updated 
https://github.com/llvm/llvm-project/pull/140145

>From 4f0eab77111d15515082c82d288f25ca88424a9e Mon Sep 17 00:00:00 2001
From: kikairoya 
Date: Mon, 21 Apr 2025 23:30:13 +0900
Subject: [PATCH 1/2] [Cygwin][MinGW] Internal class in
 explicitly-instantiation-declarated template should be instantiated

In-code comment says "explicit instantiation decl of the outer class
doesn't affect the inner class" but this behavior seems MSVC
specific, MinGW-GCC and Cygwin-GCC does not.
Clang should honor gcc's behavior.

This change fixes std::string compatibilty and resolves strange link
error (statically linked), strange crash (dynamically linked) using
libstdc++ on Cygwin.
---
 clang/lib/Sema/SemaTemplateInstantiate.cpp|   1 +
 .../CodeGenCXX/mingw-template-dllexport.cpp   | 109 +++---
 2 files changed, 93 insertions(+), 17 deletions(-)

diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp 
b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index d028eea4f8f3e..b7c27b3795f5d 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -4247,6 +4247,7 @@ Sema::InstantiateClassMembers(SourceLocation 
PointOfInstantiation,
 continue;
 
   if (Context.getTargetInfo().getTriple().isOSWindows() &&
+  !Context.getTargetInfo().getTriple().isOSCygMing() &&
   TSK == TSK_ExplicitInstantiationDeclaration) {
 // On Windows, explicit instantiation decl of the outer class doesn't
 // affect the inner class. Typically extern template declarations are
diff --git a/clang/test/CodeGenCXX/mingw-template-dllexport.cpp 
b/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
index de112d6da53db..a6047b5955e96 100644
--- a/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
+++ b/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
@@ -6,46 +6,121 @@
 #define JOIN2(x, y) x##y
 #define JOIN(x, y) JOIN2(x, y)
 #define UNIQ(name) JOIN(name, __LINE__)
-#define USEMEMFUNC(class, func) void (class::*UNIQ(use)())() { return 
&class::func; }
+#define USEMEMFUNC(class, func) auto UNIQ(use) = &class::func;
 
 template 
 class c {
+  // MinGW-GCC does not apply 'dllexport' to inline member function in 
dll-exported template but clang does from long ago.
   void f() {}
+  void g();
+  inline static int u = 0;
+  static int v;
 };
+template  void c::g() {}
+template  int c::v = 0;
 
+// #1
 template class __declspec(dllexport) c;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIiE1fEv
-
+// #2
 extern template class __declspec(dllexport) c;
 template class c;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIcE1fEv
-
+// #3
 extern template class c;
-template class __declspec(dllexport) c;
+template class __declspec(dllexport) c; // expected-warning {{ 
'dllexport' attribute ignored on explicit instantiation definition }}
 
-// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN1cIdE1fEv
 
 template 
 struct outer {
-  void f();
+  void f() {}
+  void g();
+  inline static int u = 0;
+  static int v;
+  // MinGW-GCC and Clang does not apply 'dllexport' to inner type and its 
sub-elements in template class.
   struct inner {
-void f();
+void f() {}
+void g();
+inline static int u = 0;
+static int v;
   };
 };
 
-template  void outer::f() {}
-template  void outer::inner::f() {}
+template  void outer::g() {}
+template  void outer::inner::g() {}
+template  int outer::v = 0;
+template  int outer::inner::v = 0;
 
-template class __declspec(dllexport) outer;
+// #4
+template struct __declspec(dllexport) outer;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN5outerIiE1fEv
-// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN5outerIiE5inner1fEv
-
-extern template class __declspec(dllimport) outer;
+// #5
+extern template struct __declspec(dllimport) outer;
 USEMEMFUNC(outer, f)
+USEMEMFUNC(outer, g)
+USEMEMFUNC(outer, u)
+USEMEMFUNC(outer, v)
 USEMEMFUNC(outer::inner, f)
+USEMEMFUNC(outer::inner, g)
+USEMEMFUNC(outer::inner, u)
+USEMEMFUNC(outer::inner, v)
+
+
+// #1 variables
+// CHECK: @_ZN1cIiE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIiE1vE = {{.*}} dllexport {{.*}}
+
+// #2 variables
+// CHECK: @_ZN1cIcE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIcE1vE = {{.*}} dllexport {{.*}}
+
+// #3 variables
+// CHECK: @_ZN1cIdE1uE = {{.*}}
+// CHECK-NOT: @_ZN1cIcE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIdE1vE = {{.*}}
+// CHECK-NOT: @_ZN1cIcE1vE = {{.*}} dllexport {{.*}}
+
+// #4 variables
+// CHECK: @_ZN5outerIiE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE1vE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE5inner1uE = {{.*}}
+// CHECK-NOT: @_ZN5outerIiE5inner1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE5inner1vE = {{.*}}
+// CHECK-NOT: @_ZN5outerIiE5inner1vE = {{.*}} dllexport {{.*}}
+
+// #5 variables
+// CHECK: @_ZN5outerIcE1uE = external dllimport {{.*}}
+// CHECK: @_ZN5outerIcE1vE = external dllimport {{.*}}
+// CHECK-NOT: @_ZN5outerIcE5inner1uE = dllimport {{.*}}
+// CHECK-N

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-20 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya updated 
https://github.com/llvm/llvm-project/pull/140145

>From 37af003a4cc9afb74a05cddd5118ed0695cec632 Mon Sep 17 00:00:00 2001
From: kikairoya 
Date: Mon, 21 Apr 2025 23:30:13 +0900
Subject: [PATCH 1/2] [Cygwin][MinGW] Internal class in
 explicitly-instantiation-declarated template should be instantiated

In-code comment says "explicit instantiation decl of the outer class
doesn't affect the inner class" but this behavior seems MSVC
specific, MinGW-GCC and Cygwin-GCC does not.
Clang should honor gcc's behavior.

This change fixes std::string compatibilty and resolves strange link
error (statically linked), strange crash (dynamically linked) using
libstdc++ on Cygwin.
---
 clang/lib/Sema/SemaTemplateInstantiate.cpp|   1 +
 .../CodeGenCXX/mingw-template-dllexport.cpp   | 109 +++---
 2 files changed, 93 insertions(+), 17 deletions(-)

diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp 
b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index d028eea4f8f3e..b7c27b3795f5d 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -4247,6 +4247,7 @@ Sema::InstantiateClassMembers(SourceLocation 
PointOfInstantiation,
 continue;
 
   if (Context.getTargetInfo().getTriple().isOSWindows() &&
+  !Context.getTargetInfo().getTriple().isOSCygMing() &&
   TSK == TSK_ExplicitInstantiationDeclaration) {
 // On Windows, explicit instantiation decl of the outer class doesn't
 // affect the inner class. Typically extern template declarations are
diff --git a/clang/test/CodeGenCXX/mingw-template-dllexport.cpp 
b/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
index de112d6da53db..a6047b5955e96 100644
--- a/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
+++ b/clang/test/CodeGenCXX/mingw-template-dllexport.cpp
@@ -6,46 +6,121 @@
 #define JOIN2(x, y) x##y
 #define JOIN(x, y) JOIN2(x, y)
 #define UNIQ(name) JOIN(name, __LINE__)
-#define USEMEMFUNC(class, func) void (class::*UNIQ(use)())() { return 
&class::func; }
+#define USEMEMFUNC(class, func) auto UNIQ(use) = &class::func;
 
 template 
 class c {
+  // MinGW-GCC does not apply 'dllexport' to inline member function in 
dll-exported template but clang does from long ago.
   void f() {}
+  void g();
+  inline static int u = 0;
+  static int v;
 };
+template  void c::g() {}
+template  int c::v = 0;
 
+// #1
 template class __declspec(dllexport) c;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIiE1fEv
-
+// #2
 extern template class __declspec(dllexport) c;
 template class c;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIcE1fEv
-
+// #3
 extern template class c;
-template class __declspec(dllexport) c;
+template class __declspec(dllexport) c; // expected-warning {{ 
'dllexport' attribute ignored on explicit instantiation definition }}
 
-// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN1cIdE1fEv
 
 template 
 struct outer {
-  void f();
+  void f() {}
+  void g();
+  inline static int u = 0;
+  static int v;
+  // MinGW-GCC and Clang does not apply 'dllexport' to inner type and its 
sub-elements in template class.
   struct inner {
-void f();
+void f() {}
+void g();
+inline static int u = 0;
+static int v;
   };
 };
 
-template  void outer::f() {}
-template  void outer::inner::f() {}
+template  void outer::g() {}
+template  void outer::inner::g() {}
+template  int outer::v = 0;
+template  int outer::inner::v = 0;
 
-template class __declspec(dllexport) outer;
+// #4
+template struct __declspec(dllexport) outer;
 
-// CHECK: define {{.*}} dllexport {{.*}} @_ZN5outerIiE1fEv
-// CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN5outerIiE5inner1fEv
-
-extern template class __declspec(dllimport) outer;
+// #5
+extern template struct __declspec(dllimport) outer;
 USEMEMFUNC(outer, f)
+USEMEMFUNC(outer, g)
+USEMEMFUNC(outer, u)
+USEMEMFUNC(outer, v)
 USEMEMFUNC(outer::inner, f)
+USEMEMFUNC(outer::inner, g)
+USEMEMFUNC(outer::inner, u)
+USEMEMFUNC(outer::inner, v)
+
+
+// #1 variables
+// CHECK: @_ZN1cIiE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIiE1vE = {{.*}} dllexport {{.*}}
+
+// #2 variables
+// CHECK: @_ZN1cIcE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIcE1vE = {{.*}} dllexport {{.*}}
+
+// #3 variables
+// CHECK: @_ZN1cIdE1uE = {{.*}}
+// CHECK-NOT: @_ZN1cIcE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN1cIdE1vE = {{.*}}
+// CHECK-NOT: @_ZN1cIcE1vE = {{.*}} dllexport {{.*}}
+
+// #4 variables
+// CHECK: @_ZN5outerIiE1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE1vE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE5inner1uE = {{.*}}
+// CHECK-NOT: @_ZN5outerIiE5inner1uE = {{.*}} dllexport {{.*}}
+// CHECK: @_ZN5outerIiE5inner1vE = {{.*}}
+// CHECK-NOT: @_ZN5outerIiE5inner1vE = {{.*}} dllexport {{.*}}
+
+// #5 variables
+// CHECK: @_ZN5outerIcE1uE = external dllimport {{.*}}
+// CHECK: @_ZN5outerIcE1vE = external dllimport {{.*}}
+// CHECK-NOT: @_ZN5outerIcE5inner1uE = dllimport {{.*}}
+// CHECK-N

[clang] [libcxx] [Cygwin][MinGW] Internal class in explicitly-instantiation-declarated template should be instantiated (PR #140145)

2025-05-15 Thread Tomohiro Kashiwada via cfe-commits

https://github.com/kikairoya created 
https://github.com/llvm/llvm-project/pull/140145

resolves https://github.com/llvm/llvm-project/issues/135910



  



Rate limit · GitHub


  body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe 
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
  }

  .container { margin: 50px auto; max-width: 600px; text-align: center; 
padding: 0 24px; }

  a { color: #0366d6; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px; 
text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  



  Whoa there!
  You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
  
  
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
  

  

  

  

  

  


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits