Issue 153933
Summary [clang][modules] Virtual function with dependent return type included and imported causes compiler to hang
Labels clang
Assignees
Reporter davidstone
    Given the following three files:

h.hpp:
```cxx
template<typename>
struct r {
};

template<typename T>
struct s {
	virtual r<T> v() {
		return {};
	}
};

void f() {
	s<void> x;
}
```

a.cpp:
```cxx
module;

#include "h.hpp"

export module a;
```

b.cpp:
```cxx
#include "h.hpp"

import a;
```

after compiling `clang++ -std=c++20 -x c++-module --precompile a.cpp -o a.pcm`, the command `clang++ -std=c++20 -fmodule-file=a=a.pcm -c b.cpp` never completes.

This was introduced in one of

190ad0b1275de7fae75b0ed4add250ee1e52b813
d1827f040f6e056e62cf4158bdf90d0acdf3d287
5ebb22de6ac0dd4fa8d024957b8f2c9537256c73
92a966bd8f9fc5cd490ab956de202cd622cd7d32
39941a2dbc71d570421d90d409ccfc8d92d535f5
7fb8630e71c4b5028f9ad7d413144f48b13eb857
e86c9b6b1b1becf86fcde8f66d3f0b214b30ace8
e98b8cbf555a94fbe99150ab36d909c4c6a5ccfc
7a6c9813d69bf390ab2db3b060305b6aade7703b
870aa979c4854d23e368845acd459d1e4ff7d2e0
24b772769f47f2c884ffab64a24444da9968094f
f89306fe74434c55fc7844532f1a3bdaf9a838ea
62735d26b1a1bdb5d03c594c958a0d01a4f8b486
723de7f23196393d2323e62d50bedba4492139ef
aee4f2baccdbc018d0ac60eaa4e2a0a5f30bcdf5
b9fef09e8e5144c9d7e43a64df6df374efc91c90
06fd0f9d65a8be50ba3640e1ab878ea02ab053f8
2f8e4f8b2613800b81c656b4733a85ad52b5e853
10e146a7161065429629a13f99c179a61ffe7721
dea50a1797c9cb70ce86284c25cc9277f3d88fc8
160f5ca0f5e32b56559fdd6d993b0c7997adf6ff
d9199a85e1382a87aedc7edae30c98ef3f434308
91cdd35008e9ab32dffb7e401cdd7313b3461892
c9b62427716f41cf33b932a5622d8ef5b588f1c0
34164da5cd3d2bd965e1991d88bdb99fbb798090

git bisect cannot reduce it any further because most of those commits fail to compile. I suspect the culprit is 91cdd35008e9ab32dffb7e401cdd7313b3461892 @mizvekov based solely on "539 files changed +11195 -10586 lines changed". The first commit that successfully compiles and causes the hang is 34164da5cd3d2bd965e1991d88bdb99fbb798090.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to