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
Copy file name to clipboardExpand all lines: clang/test/Modules/odr_hash-gnu.cpp
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -65,9 +65,10 @@ Invalid1 i1;
65
65
//[email protected]:* {{'Types::TypeOfExpr::Invalid1' has different definitions in different modules; first difference is definition in module 'FirstModule' found field 'x' with type 'typeof (1 + 2)' (aka 'int')}}
66
66
//[email protected]:* {{but in 'SecondModule' found field 'x' with type 'typeof (3)' (aka 'int')}}
67
67
Invalid2 i2;
68
-
//[email protected]:* {{'Types::TypeOfExpr::Invalid2::x' from module 'SecondModule' is not present in definition of 'Types::TypeOfExpr::Invalid2' in module 'FirstModule'}}
// FIXME: We should diagnose the different definitions of `global`.
71
72
#endif
72
73
} // namespace TypeOfExpr
73
74
@@ -113,8 +114,9 @@ Invalid2 i2;
113
114
//[email protected]:* {{'Types::TypeOf::Invalid2' has different definitions in different modules; first difference is definition in module 'FirstModule' found field 'x' with type 'typeof(int)' (aka 'int')}}
114
115
//[email protected]:* {{but in 'SecondModule' found field 'x' with type 'typeof(I)' (aka 'int')}}
115
116
Invalid3 i3;
116
-
//[email protected]:* {{'Types::TypeOf::Invalid3::x' from module 'SecondModule' is not present in definition of 'Types::TypeOf::Invalid3' in module 'FirstModule'}}
// FIXME: We should reject the merge of `S3` due to the inconsistent definition of `T`.
1177
1175
#endif
1178
1176
1179
1177
#if defined(FIRST)
@@ -1361,8 +1359,6 @@ struct S1 {
1361
1359
};
1362
1360
#else
1363
1361
S1 s1;
1364
-
//[email protected]:* {{'ElaboratedType::S1::x' from module 'FirstModule' is not present in definition of 'ElaboratedType::S1' in module 'SecondModule'}}
//[email protected]:* {{'Types::Decltype::invalid1' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
3617
3613
//[email protected]:* {{but in 'FirstModule' found a different body}}
3618
3614
auto function2 = invalid2;
3619
-
//[email protected]:* {{'Types::Decltype::invalid2' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
3620
-
//[email protected]:* {{but in 'FirstModule' found a different body}}
3615
+
//FIXME: We should reject the merge of `invalid2` and diagnose about the
3616
+
//inconsistent definition of `global`.
3621
3617
auto function3 = valid;
3622
3618
#endif
3623
3619
} // namespace Decltype
@@ -3700,8 +3696,7 @@ void valid() {
3700
3696
}
3701
3697
#else
3702
3698
auto function1 = invalid1;
3703
-
//[email protected]:* {{'Types::DeducedTemplateSpecialization::invalid1' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
3704
-
//[email protected]:* {{but in 'FirstModule' found a different body}}
3699
+
// FIXME: We should reject the merge of `invalid1` due to the inconsistent definition.
3705
3700
auto function2 = invalid2;
3706
3701
//[email protected]:* {{'Types::DeducedTemplateSpecialization::invalid2' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
3707
3702
//[email protected]:* {{but in 'FirstModule' found a different body}}
@@ -4946,8 +4941,42 @@ class S4 {
4946
4941
#else
4947
4942
S4 s4;
4948
4943
#endif
4944
+
4945
+
#if defined(FIRST)
4946
+
namespaceNS5 {
4947
+
structT5;
4948
+
} // namespace NS5
4949
+
classS5 {
4950
+
NS5::T5* t = 0;
4951
+
};
4952
+
#elif defined(SECOND)
4953
+
namespaceNS5 {
4954
+
typedefstructT5_Other {} T5;
4955
+
} // namespace NS4
4956
+
classS5 {
4957
+
NS5::T5* t = 0;
4958
+
};
4959
+
#else
4960
+
S5 s5;
4961
+
//[email protected]:* {{'TypedefStruct::S5::t' from module 'FirstModule' is not present in definition of 'TypedefStruct::S5' in module 'SecondModule'}}
Copy file name to clipboardExpand all lines: clang/test/Modules/odr_hash.mm
+8-14Lines changed: 8 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -112,8 +112,7 @@ void valid() {
112
112
//[email protected]:* {{Types::Attributed::invalid1' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
113
113
//[email protected]:* {{but in 'FirstModule' found a different body}}
114
114
auto function2 = invalid2;
115
-
//[email protected]:* {{'Types::Attributed::invalid2' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
116
-
//[email protected]:* {{but in 'FirstModule' found a different body}}
//[email protected]:* {{'Types::ObjCTypeParam::Invalid1::x' from module 'FirstModule' is not present in definition of 'Types::ObjCTypeParam::Invalid1' in module 'SecondModule'}}
//[email protected]:* {{'Types::ObjCTypeParam::Invalid2::y' from module 'FirstModule' is not present in definition of 'Types::ObjCTypeParam::Invalid2' in module 'SecondModule'}}
//[email protected]:* {{'Types::ObjCTypeParam::Invalid3::z' from module 'FirstModule' is not present in definition of 'Types::ObjCTypeParam::Invalid3' in module 'SecondModule'}}
0 commit comments