Skip to content

Fix subscript-expression to comply with C++23 comma separator rules #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/bll_compatibility/algorithm_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void test_foreach() {
// var replaced with ref, protect(..) replaced with lambda[..], no need for bind
// phoenix algorithms are range based
std::for_each(a, a + 10,
phoenix::for_each(_1, lambda[_1 = ref(sum), ++ref(sum)]));
phoenix::for_each(_1, lambda[(_1 = ref(sum), ++ref(sum))]));
/*phoenix::bind(phoenix::for_each, _1,
lambda[_1 = ref(sum), ++ref(sum)]));*/

Expand Down
12 changes: 6 additions & 6 deletions test/statement/exceptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ int main()
try_
[ throw_(runtime_error("error")) ]
.catch_<exception>(_e)
[
[(
ref(caught_exception) = true
// ambiguous with std::ref
, phx::ref(what) = phx::bind(&exception::what, _e)
]();
)]();

BOOST_TEST(caught_exception);
BOOST_TEST(what == string("error"));
Expand All @@ -138,11 +138,11 @@ int main()
try_
[ throw_(extended_exception("error")) ]
.catch_<base_exception>(_e) // A thrown object should not be copied due to slicing.
[
[(
ref(caught_exception) = true
// ambiguous with std::ref
, phx::ref(what) = phx::bind(&exception::what, _e)
]();
)]();

BOOST_TEST(caught_exception);
BOOST_TEST(what == string("error"));
Expand All @@ -167,11 +167,11 @@ int main()
.catch_<string>()
[ ref(caught_correct_exception) = false ]
.catch_<exception>(_e)
[
[(
ref(caught_correct_exception) = true
// ambiguous with std::ref
, phx::ref(what) = phx::bind(&exception::what, _e)
]();
)]();

BOOST_TEST(caught_correct_exception);
BOOST_TEST(what == string("error"));
Expand Down
12 changes: 6 additions & 6 deletions test/statement/if_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ main()

for_each(v.begin(), v.end(),
if_(arg1 > 3 && arg1 <= 8)
[
[(
std::cout << arg1 << ", ",
ref(x) += arg1
]
)]
);

std::cout << std::endl;
Expand All @@ -49,15 +49,15 @@ main()
.else_
[
if_(arg1 == 5)
[
[(
std::cout << arg1 << " == 5\n",
ref(z) += arg1
]
)]
.else_
[
[(
std::cout << arg1 << " < 5\n",
ref(y) += arg1
]
)]
]
);

Expand Down
12 changes: 6 additions & 6 deletions test/statement/loops_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ main()
for_each(v.begin(), v.end(),
(
while_(arg1--)
[
[(
cout << arg1 << ", ",
++ref(x)
],
)],
cout << val("\n")
)
);
Expand All @@ -50,10 +50,10 @@ main()
for_each(v.begin(), v.end(),
(
do_
[
[(
cout << arg1 << ", ",
++ref(x)
]
)]
.while_(arg1--),
cout << val("\n")
)
Expand All @@ -68,10 +68,10 @@ main()
for_each(v.begin(), v.end(),
(
for_(ref(iii) = 0, ref(iii) < arg1, ++ref(iii))
[
[(
cout << arg1 << ", ",
++ref(x)
],
)],
cout << val("\n")
)
);
Expand Down
8 changes: 4 additions & 4 deletions test/statement/switch_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,25 @@ main()

for_each(v.begin(), v.end(),
switch_(_1)
[
[(
case_<1>(cout << val("<1>") << endl),
case_<2>(cout << val("<2>") << endl),
case_<3>(cout << val("<3>") << endl),
case_<4>(cout << val("<4>") << endl)
]
)]
);

cout << endl;

for_each(v.begin(), v.end(),
switch_(_1)
[
[(
case_<1>(cout << val("<1>") << endl),
case_<2>(cout << val("<2>") << endl),
case_<3>(cout << val("<3>") << endl),
case_<4>(cout << val("<4>") << endl),
default_(cout << val("<over 4>") << endl)
]
)]
);

return boost::report_errors();
Expand Down
Loading