You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Close#79240
Cite the comment from @mizvekov in
//github.com//issues/79240:
> There are two kinds of bugs / issues relevant here:
>
> Clang bugs that this change hides
> Here we can add a Frontend flag that disables the GMF ODR check, just
> so
> we can keep tracking, testing and fixing these issues.
> The Driver would just always pass that flag.
> We could add that flag in this current issue.
> Bugs in user code:
> I don't think it's worth adding a corresponding Driver flag for
> controlling the above Frontend flag, since we intend it's behavior to
> become default as we fix the problems, and users interested in testing
> the more strict behavior can just use the Frontend flag directly.
This patch follows the suggestion:
- Introduce the CC1 flag `-fskip-odr-check-in-gmf` which is by default
off, so that the every existing test will still be tested with checking
ODR violations.
- Passing `-fskip-odr-check-in-gmf` in the driver to keep the behavior
we intended.
- Edit the document to tell the users who are still interested in more
strict checks can use `-Xclang -fno-skip-odr-check-in-gmf` to get the
existing behavior.
// This is actually an ODR violation. But given https://github.com/llvm/llvm-project/issues/79240,
50
-
// we don't count it as an ODR violation any more.
51
-
// expected-no-diagnostics
52
55
module;
53
56
#include "bar.h"
54
57
export module b;
55
58
import a;
59
+
60
+
#ifdef SKIP_ODR_CHECK_IN_GMF
61
+
// expected-no-diagnostics
62
+
#else
63
+
// expected-error@* {{has different definitions in different modules; first difference is defined here found data member '_S_copy_ctor' with an initializer}}
64
+
// expected-note@* {{but in 'a.<global>' found data member '_S_copy_ctor' with a different initializer}}
65
+
// expected-error@* {{from module 'a.<global>' is not present in definition of 'variant<_Types...>' provided earlier}}
66
+
// expected-note@* {{declaration of 'swap' does not match}}
// This is actually an ODR violation. But given https://github.com/llvm/llvm-project/issues/79240,
61
-
// we don't count it as an ODR violation now.
62
-
// expected-no-diagnostics
63
66
module;
64
67
#include "signed_size_t.h"
65
68
#include "csize_t"
66
69
#include "align.h"
67
70
export module mod4;
68
71
import mod3;
69
72
export using std::align_val_t;
73
+
74
+
#ifdef SKIP_ODR_CHECK_IN_GMF
75
+
// expected-no-diagnostics
76
+
#else
77
+
// [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')}}
78
+
// [email protected]:* {{but in 'mod3.<global>' found enum with specified type 'size_t' (aka 'unsigned int')}}
0 commit comments