-
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.
[C++20] [Modules] Don't perform ODR checks in GMF
Close #79240. See the linked issue for details. Given the frequency of issue reporting about false positive ODR checks (I received private issue reports too), I'd like to backport this to 18.x too.
- Loading branch information
1 parent
0fbaf03
commit a0b6747
Showing
10 changed files
with
68 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,13 +70,6 @@ module; | |
export module B; | ||
import A; | ||
|
||
#ifdef DIFFERENT | ||
// [email protected]:41 {{'__fn::operator()' from module 'A.<global>' is not present in definition of '__fn' provided earlier}} | ||
// expected-note@* 1+{{declaration of 'operator()' does not match}} | ||
#else | ||
// expected-no-diagnostics | ||
#endif | ||
|
||
template <class T> | ||
struct U { | ||
auto operator+(U) { return 0; } | ||
|
@@ -94,3 +87,10 @@ void foo() { | |
|
||
__fn{}(U<int>(), U<int>()); | ||
} | ||
|
||
#ifdef DIFFERENT | ||
// [email protected]:* {{call to object of type '__fn' is ambiguous}} | ||
// expected-note@* 1+{{candidate function}} | ||
#else | ||
// expected-no-diagnostics | ||
#endif |
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 |
---|---|---|
|
@@ -57,13 +57,13 @@ export module mod3; | |
export using std::align_val_t; | ||
|
||
//--- mod4.cppm | ||
// This is actually an ODR violation. But given https://github.com/llvm/llvm-project/issues/79240, | ||
// we don't count it as an ODR violation now. | ||
// expected-no-diagnostics | ||
module; | ||
#include "signed_size_t.h" | ||
#include "csize_t" | ||
#include "align.h" | ||
export module mod4; | ||
import mod3; | ||
export using std::align_val_t; | ||
|
||
// [email protected]:* {{'std::align_val_t' has different definitions in different modules; defined here first difference is enum with specified type 'size_t' (aka 'int')}} | ||
// [email protected]:* {{but in 'mod3.<global>' found enum with specified type 'size_t' (aka 'unsigned int')}} |