-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Serialization] Add a callback to register new created predefined dec…
…ls for DeserializationListener (#102855) Close #102684 The root cause of the issue is, it is possible that the predefined decl is not registered at the beginning of writing a module file but got created during the process of writing from reading. This is incorrect. The predefined decls should always be predefined decls. Another deep thought about the issue is, we shouldn't read any new things after we start to write the module file. But this is another deeper question.
- Loading branch information
1 parent
a0241e7
commit 4915fdd
Showing
8 changed files
with
129 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// RUN: rm -rf %t | ||
// RUN: mkdir -p %t | ||
// RUN: split-file %s %t | ||
// | ||
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm | ||
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/b.pcm \ | ||
// RUN: -fprebuilt-module-path=%t | ||
// RUN: %clang_cc1 -std=c++20 %t/test.cpp -fsyntax-only -verify \ | ||
// RUN: -fprebuilt-module-path=%t | ||
|
||
//--- a.cppm | ||
export module a; | ||
|
||
namespace n { | ||
template<typename, int...> | ||
struct integer_sequence { | ||
|
||
}; | ||
|
||
export template<typename> | ||
using make_integer_sequence = __make_integer_seq<integer_sequence, int, 0>; | ||
} | ||
|
||
//--- b.cppm | ||
export module b; | ||
import a; | ||
|
||
export template<typename T> | ||
void b() { | ||
n::make_integer_sequence<T>(); | ||
} | ||
|
||
//--- test.cpp | ||
// expected-no-diagnostics | ||
import b; | ||
void test() { | ||
b<int>(); | ||
} |