Author: Chuanqi Xu
Date: 2025-12-19T16:08:05+08:00
New Revision: c6cccbfe08b35c2538b4120b6764d73034970391

URL: 
https://github.com/llvm/llvm-project/commit/c6cccbfe08b35c2538b4120b6764d73034970391
DIFF: 
https://github.com/llvm/llvm-project/commit/c6cccbfe08b35c2538b4120b6764d73034970391.diff

LOG: [NFC] [C++20] [Modules] Add test for issue 137533

Close https://github.com/llvm/llvm-project/issues/137533

This may be fixed by other PR before. Adding a test for avoid further 
regression.

Added: 
    clang/test/Modules/pr137533.cppm

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/clang/test/Modules/pr137533.cppm 
b/clang/test/Modules/pr137533.cppm
new file mode 100644
index 0000000000000..72190aa16f46c
--- /dev/null
+++ b/clang/test/Modules/pr137533.cppm
@@ -0,0 +1,25 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: split-file %s %t
+//
+// RUN: %clang_cc1 -std=c++20 %t/m.cppm -emit-module-interface -o %t/m.pcm
+// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fmodule-file=m=%t/m.pcm 
-fsyntax-only -verify
+//
+// RUN: %clang_cc1 -std=c++20 %t/m.cppm -emit-reduced-module-interface -o 
%t/m.pcm
+// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fmodule-file=m=%t/m.pcm 
-fsyntax-only -verify
+
+//--- m.cppm
+export module m;
+static const char * f() { return "m.cppm"; }
+export auto &fr = f;
+
+//--- use.cpp
+// expected-no-diagnostics
+import m;
+static const char * f() { return "use.cpp"; }
+constexpr auto &fr1 = f;
+auto &fr2 = fr;
+int main() {
+  fr1();
+  fr2();
+}


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to