-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close #63947 Close #63595 This is suggested by @rsmith in https://reviews.llvm.org/D154324#inline-1508868 Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D156210
- Loading branch information
1 parent
fac7c32
commit c31d6b4
Showing
5 changed files
with
118 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// RUN: rm -rf %t | ||
// RUN: mkdir %t | ||
// RUN: split-file %s %t | ||
// | ||
// RUN: %clang_cc1 -std=c++20 -emit-module-interface -I%t %t/module1.cppm -o %t/module1.pcm | ||
// RUN: %clang_cc1 -std=c++20 -emit-module-interface -I%t %t/module2.cppm -o %t/module2.pcm | ||
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/merge.cpp -verify -fsyntax-only | ||
|
||
//--- header.h | ||
namespace NS { | ||
template <int I> | ||
class A { | ||
}; | ||
|
||
template <template <int I_> class T> | ||
class B { | ||
}; | ||
} | ||
|
||
//--- module1.h | ||
namespace NS { | ||
using C = B<A>; | ||
} | ||
struct D : NS::C { | ||
using Type = NS::C; | ||
}; | ||
|
||
//--- module1.cppm | ||
// inside NS, using C = B<A> | ||
module; | ||
#include "header.h" | ||
#include "module1.h" | ||
export module module1; | ||
export using ::D; | ||
|
||
//--- module2.h | ||
namespace NS { | ||
using C = B<NS::A>; | ||
} | ||
struct D : NS::C { | ||
using Type = NS::C; | ||
}; | ||
|
||
//--- module2.cppm | ||
// inside NS, using C = B<NS::A> | ||
module; | ||
#include "header.h" | ||
#include "module2.h" | ||
export module module2; | ||
export using ::D; | ||
|
||
//--- merge.cpp | ||
// expected-no-diagnostics | ||
import module1; | ||
import module2; | ||
D d; |