[clang] a6f56a6 - Revert "[NFC] [C++20] [Modules] Add tests for template instantiation in transitively imported module"

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 21 02:34:39 PST 2021


Author: Chuanqi Xu
Date: 2021-12-21T18:34:27+08:00
New Revision: a6f56a622d96de24f183d7eed5a4fa9925c49992

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

LOG: Revert "[NFC] [C++20] [Modules] Add tests for template instantiation in transitively imported module"

This reverts commit 4f103e956157515dd800951f73ed550b1a0477f4.

The tests couldn't pass under windows.

Added: 
    

Modified: 
    

Removed: 
    clang/test/Modules/Inputs/module-transtive-instantiation/Templ.cppm
    clang/test/Modules/Inputs/module-transtive-instantiation/bar.cppm
    clang/test/Modules/module-transtive-instantiation-2.cpp
    clang/test/Modules/module-transtive-instantiation.cpp


################################################################################
diff  --git a/clang/test/Modules/Inputs/module-transtive-instantiation/Templ.cppm b/clang/test/Modules/Inputs/module-transtive-instantiation/Templ.cppm
deleted file mode 100644
index ee41b5374613f..0000000000000
--- a/clang/test/Modules/Inputs/module-transtive-instantiation/Templ.cppm
+++ /dev/null
@@ -1,8 +0,0 @@
-export module Templ;
-export template <class T>
-class G {
-public:
-    T operator()() {
-        return T();
-    }
-};

diff  --git a/clang/test/Modules/Inputs/module-transtive-instantiation/bar.cppm b/clang/test/Modules/Inputs/module-transtive-instantiation/bar.cppm
deleted file mode 100644
index 63cd595a642dc..0000000000000
--- a/clang/test/Modules/Inputs/module-transtive-instantiation/bar.cppm
+++ /dev/null
@@ -1,6 +0,0 @@
-export module bar;
-import Templ;
-export template<class T>
-int bar() {
-    return G<T>()();
-}

diff  --git a/clang/test/Modules/module-transtive-instantiation-2.cpp b/clang/test/Modules/module-transtive-instantiation-2.cpp
deleted file mode 100644
index 647971776aa13..0000000000000
--- a/clang/test/Modules/module-transtive-instantiation-2.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: rm -rf %t
-// RUN: mkdir -p %t
-// RUN: %clang -std=c++20 %S/Inputs/module-transtive-instantiation/Templ.cppm --precompile -o %t/Templ.pcm
-// RUN: %clang -std=c++20 %S/Inputs/module-transtive-instantiation/bar.cppm  --precompile -fprebuilt-module-path=%t -o %t/bar.pcm
-// RUN: %clang -std=c++20 -fprebuilt-module-path=%t %s -c -Xclang -verify
-
-import bar;
-int foo() {
-    G<int> g;    // expected-error {{declaration of 'G' must be imported from module 'Templ' before it is required}}
-    return g();  // expected-note at Inputs/module-transtive-instantiation/Templ.cppm:3 {{declaration here is not visible}}
-}

diff  --git a/clang/test/Modules/module-transtive-instantiation.cpp b/clang/test/Modules/module-transtive-instantiation.cpp
deleted file mode 100644
index 4c095bfbbce6a..0000000000000
--- a/clang/test/Modules/module-transtive-instantiation.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: rm -rf %t
-// RUN: mkdir -p %t
-// RUN: %clang -std=c++20 %S/Inputs/module-transtive-instantiation/Templ.cppm --precompile -o %t/Templ.pcm
-// RUN: %clang -std=c++20 %S/Inputs/module-transtive-instantiation/bar.cppm  --precompile -fprebuilt-module-path=%t -o %t/bar.pcm
-// RUN: %clang -std=c++20 -fprebuilt-module-path=%t %s -c -Xclang -verify
-
-import bar;
-int foo() {
-    // FIXME: It shouldn't be an error. Since the `G` is already imported in bar.
-    return bar<int>(); // expected-error at Inputs/module-transtive-instantiation/bar.cppm:5 {{definition of 'G' must be imported from module 'Templ' before it is required}}
-                       // expected-note at -1 {{in instantiation of function template specialization 'bar<int>' requested here}}
-                       // expected-note at Inputs/module-transtive-instantiation/Templ.cppm:3 {{definition here is not reachable}}
-}


        


More information about the cfe-commits mailing list