File tree Expand file tree Collapse file tree 6 files changed +50
-0
lines changed
test/library-tests/special_members/generated_copy Expand file tree Collapse file tree 6 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ category : minorAnalysis
3
+ ---
4
+ * ` hasImplicitCopyConstructor ` and ` hasImplicitCopyAssignmentOperator ` now correctly handle implicitly-deleted operators in templates.
Original file line number Diff line number Diff line change @@ -251,6 +251,16 @@ class Class extends UserType {
251
251
not this .implicitCopyConstructorDeleted ( ) and
252
252
forall ( CopyConstructor cc | cc = this .getAMemberFunction ( ) |
253
253
cc .isCompilerGenerated ( ) and not cc .isDeleted ( )
254
+ ) and
255
+ (
256
+ not this instanceof ClassTemplateInstantiation
257
+ or
258
+ this .( ClassTemplateInstantiation ) .getTemplate ( ) .hasImplicitCopyConstructor ( )
259
+ ) and
260
+ (
261
+ not this instanceof PartialClassTemplateSpecialization
262
+ or
263
+ this .( PartialClassTemplateSpecialization ) .getPrimaryTemplate ( ) .hasImplicitCopyConstructor ( )
254
264
)
255
265
}
256
266
@@ -266,6 +276,18 @@ class Class extends UserType {
266
276
not this .implicitCopyAssignmentOperatorDeleted ( ) and
267
277
forall ( CopyAssignmentOperator ca | ca = this .getAMemberFunction ( ) |
268
278
ca .isCompilerGenerated ( ) and not ca .isDeleted ( )
279
+ ) and
280
+ (
281
+ not this instanceof ClassTemplateInstantiation
282
+ or
283
+ this .( ClassTemplateInstantiation ) .getTemplate ( ) .hasImplicitCopyAssignmentOperator ( )
284
+ ) and
285
+ (
286
+ not this instanceof PartialClassTemplateSpecialization
287
+ or
288
+ this .( PartialClassTemplateSpecialization )
289
+ .getPrimaryTemplate ( )
290
+ .hasImplicitCopyAssignmentOperator ( )
269
291
)
270
292
}
271
293
Original file line number Diff line number Diff line change 11
11
| difference::Base | can | does NOT | have implicit copy assignment |
12
12
| difference::OnlyAssign | can | does | have implicit copy assignment |
13
13
| difference::OnlyCtor | can NOT | does NOT | have implicit copy assignment |
14
+ | instantiated_explicit_ctor::Wrapper<int> | can | does | have implicit copy assignment |
14
15
| moves::MoveAssign | can NOT | does NOT | have implicit copy assignment |
15
16
| moves::MoveCtor | can NOT | does NOT | have implicit copy assignment |
16
17
| private_cc::C | can | does NOT | have implicit copy assignment |
Original file line number Diff line number Diff line change @@ -131,3 +131,21 @@ namespace difference {
131
131
class OnlyAssign : Base {
132
132
};
133
133
}
134
+
135
+ namespace instantiated_explicit_ctor {
136
+ template <class T >
137
+ class Wrapper {
138
+ public:
139
+ Wrapper (Wrapper<T> &other) {
140
+ m_t = other.m_t ;
141
+ }
142
+
143
+ Wrapper () {
144
+ m_t = 0 ;
145
+ }
146
+ private:
147
+ T m_t ;
148
+ };
149
+
150
+ Wrapper<int > wrapped_int;
151
+ }
Original file line number Diff line number Diff line change 11
11
| difference::Base | can | does NOT | have implicit copy constructor |
12
12
| difference::OnlyAssign | can NOT | does NOT | have implicit copy constructor |
13
13
| difference::OnlyCtor | can | does | have implicit copy constructor |
14
+ | instantiated_explicit_ctor::Wrapper<int> | can | does NOT | have implicit copy constructor |
14
15
| moves::MoveAssign | can NOT | does NOT | have implicit copy constructor |
15
16
| moves::MoveCtor | can NOT | does NOT | have implicit copy constructor |
16
17
| private_cc::C | can | does NOT | have implicit copy constructor |
Original file line number Diff line number Diff line change 86
86
| copy.cpp:131:9:131:9 | OnlyAssign | deleted | |
87
87
| copy.cpp:131:9:131:9 | operator= | | |
88
88
| copy.cpp:131:9:131:9 | operator= | | |
89
+ | copy.cpp:137:9:137:9 | operator= | | |
90
+ | copy.cpp:139:5:139:11 | Wrapper | | |
91
+ | copy.cpp:143:5:143:5 | Wrapper | | |
92
+ | copy.cpp:143:5:143:11 | Wrapper | | |
89
93
| file://:0:0:0:0 | operator= | | |
90
94
| file://:0:0:0:0 | operator= | | |
You can’t perform that action at this time.
0 commit comments