Skip to content

Commit f608b78

Browse files
committed
Better fix for #291, closes #312
1 parent 63efa6e commit f608b78

15 files changed

+50
-65
lines changed
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
pure2-types-smf-and-that-1-provide-everything.cpp2:24:16: warning: braces around scalar initializer [-Wbraced-scalar-init]
2-
addr = {"123 Ford Dr."};
3-
^~~~~~~~~~~~~~~~
4-
1 warning generated.
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
pure2-types-smf-and-that-2-provide-mvconstruct-and-cpassign.cpp2:24:16: warning: braces around scalar initializer [-Wbraced-scalar-init]
2-
addr = {"123 Ford Dr."};
3-
^~~~~~~~~~~~~~~~
4-
1 warning generated.
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
pure2-types-smf-and-that-3-provide-mvconstruct-and-mvassign.cpp2:24:16: warning: braces around scalar initializer [-Wbraced-scalar-init]
2-
addr = {"123 Ford Dr."};
3-
^~~~~~~~~~~~~~~~
4-
1 warning generated.
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
pure2-types-smf-and-that-4-provide-cpassign-and-mvassign.cpp2:24:16: warning: braces around scalar initializer [-Wbraced-scalar-init]
2-
addr = {"123 Ford Dr."};
3-
^~~~~~~~~~~~~~~~
4-
1 warning generated.
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
pure2-types-smf-and-that-5-provide-nothing-but-general-case.cpp2:24:16: warning: braces around scalar initializer [-Wbraced-scalar-init]
2-
addr = {"123 Ford Dr."};
3-
^~~~~~~~~~~~~~~~
4-
1 warning generated.

regression-tests/test-results/pure2-types-basics.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ namespace N {
8484
}
8585
#line 6 "pure2-types-basics.cpp2"
8686
auto myclass::operator=(cpp2::in<int> x) -> myclass& {
87-
data = {x};
88-
more = {std::to_string(42 * 12)};
87+
data = x;
88+
more = std::to_string(42 * 12);
8989

9090
#line 9 "pure2-types-basics.cpp2"
9191
std::cout << "myclass: implicit from int\n";
@@ -106,8 +106,8 @@ namespace N {
106106
}
107107
#line 13 "pure2-types-basics.cpp2"
108108
auto myclass::operator=(cpp2::in<std::string> s) -> myclass& {
109-
data = {99};
110-
more = {s};
109+
data = 99;
110+
more = s;
111111

112112
#line 16 "pure2-types-basics.cpp2"
113113
std::cout << "myclass: explicit from string\n";

regression-tests/test-results/pure2-types-order-independence-and-nesting.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ namespace N {
116116
#line 10 "pure2-types-order-independence-and-nesting.cpp2"
117117
auto X::operator=(cpp2::out<Y> y) -> X& {
118118
y.construct(&(*this));
119-
py = {&y.value()};
119+
py = &y.value();
120120

121121
#line 31 "pure2-types-order-independence-and-nesting.cpp2"
122122
std::cout << "made a safely initialized cycle\n";
@@ -140,7 +140,7 @@ namespace N {
140140
{ }
141141
#line 49 "pure2-types-order-independence-and-nesting.cpp2"
142142
auto Y::operator=(cpp2::in<X*> x) -> Y& {
143-
px = {x};
143+
px = x;
144144
return *this;
145145
#line 49 "pure2-types-order-independence-and-nesting.cpp2"
146146
}

regression-tests/test-results/pure2-types-smf-and-that-1-provide-everything.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ auto main() -> int;
6969
}
7070

7171
auto myclass::operator=(myclass const& that) -> myclass& {
72-
name = {that.name};
73-
addr = {that.addr + "(AC)"};
72+
name = that.name;
73+
addr = that.addr + "(AC)";
7474

7575
#line 15 "pure2-types-smf-and-that-1-provide-everything.cpp2"
7676
std::cout << "assign - copy ";
@@ -79,8 +79,8 @@ auto main() -> int;
7979
}
8080

8181
auto myclass::operator=(myclass&& that) -> myclass& {
82-
name = {std::move(that).name};
83-
addr = {std::move(that).addr};
82+
name = std::move(that).name;
83+
addr = std::move(that).addr;
8484
#line 19 "pure2-types-smf-and-that-1-provide-everything.cpp2"
8585
std::cout << "assign - move ";
8686
return *this;
@@ -96,8 +96,8 @@ auto main() -> int;
9696
}
9797
#line 22 "pure2-types-smf-and-that-1-provide-everything.cpp2"
9898
auto myclass::operator=(cpp2::in<std::string> x) -> myclass& {
99-
name = {x};
100-
addr = {"123 Ford Dr."};
99+
name = x;
100+
addr = "123 Ford Dr.";
101101

102102
#line 24 "pure2-types-smf-and-that-1-provide-everything.cpp2"
103103
std::cout << "ctor - from string ";

regression-tests/test-results/pure2-types-smf-and-that-2-provide-mvconstruct-and-cpassign.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ auto main() -> int;
7272
}
7373

7474
auto myclass::operator=(myclass const& that) -> myclass& {
75-
name = {that.name};
76-
addr = {that.addr + "(AC)"};
75+
name = that.name;
76+
addr = that.addr + "(AC)";
7777

7878
#line 15 "pure2-types-smf-and-that-2-provide-mvconstruct-and-cpassign.cpp2"
7979
std::cout << "assign - copy ";
@@ -82,8 +82,8 @@ auto main() -> int;
8282
}
8383
#line 13 "pure2-types-smf-and-that-2-provide-mvconstruct-and-cpassign.cpp2"
8484
auto myclass::operator=(myclass&& that) -> myclass& {
85-
name = {std::move(that).name};
86-
addr = {std::move(that).addr + "(AC)"};
85+
name = std::move(that).name;
86+
addr = std::move(that).addr + "(AC)";
8787

8888
#line 15 "pure2-types-smf-and-that-2-provide-mvconstruct-and-cpassign.cpp2"
8989
std::cout << "assign - copy ";
@@ -101,8 +101,8 @@ auto main() -> int;
101101
}
102102
#line 22 "pure2-types-smf-and-that-2-provide-mvconstruct-and-cpassign.cpp2"
103103
auto myclass::operator=(cpp2::in<std::string> x) -> myclass& {
104-
name = {x};
105-
addr = {"123 Ford Dr."};
104+
name = x;
105+
addr = "123 Ford Dr.";
106106

107107
#line 24 "pure2-types-smf-and-that-2-provide-mvconstruct-and-cpassign.cpp2"
108108
std::cout << "ctor - from string ";

regression-tests/test-results/pure2-types-smf-and-that-3-provide-mvconstruct-and-mvassign.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ auto main() -> int;
6464
}
6565
#line 4 "pure2-types-smf-and-that-3-provide-mvconstruct-and-mvassign.cpp2"
6666
auto myclass::operator=(myclass const& that) -> myclass& {
67-
name = {that.name};
68-
addr = {that.addr};
67+
name = that.name;
68+
addr = that.addr;
6969
#line 5 "pure2-types-smf-and-that-3-provide-mvconstruct-and-mvassign.cpp2"
7070
std::cout << "ctor - copy (GENERAL)";
7171
return *this;
@@ -83,8 +83,8 @@ auto main() -> int;
8383

8484
#line 18 "pure2-types-smf-and-that-3-provide-mvconstruct-and-mvassign.cpp2"
8585
auto myclass::operator=(myclass&& that) -> myclass& {
86-
name = {std::move(that).name};
87-
addr = {std::move(that).addr};
86+
name = std::move(that).name;
87+
addr = std::move(that).addr;
8888
#line 19 "pure2-types-smf-and-that-3-provide-mvconstruct-and-mvassign.cpp2"
8989
std::cout << "assign - move ";
9090
return *this;
@@ -100,8 +100,8 @@ auto main() -> int;
100100
}
101101
#line 22 "pure2-types-smf-and-that-3-provide-mvconstruct-and-mvassign.cpp2"
102102
auto myclass::operator=(cpp2::in<std::string> x) -> myclass& {
103-
name = {x};
104-
addr = {"123 Ford Dr."};
103+
name = x;
104+
addr = "123 Ford Dr.";
105105

106106
#line 24 "pure2-types-smf-and-that-3-provide-mvconstruct-and-mvassign.cpp2"
107107
std::cout << "ctor - from string ";

0 commit comments

Comments
 (0)