diff --git a/regression-tests/mixed-type-safety-1.cpp2 b/regression-tests/mixed-type-safety-1.cpp2 index 890471c2e..2571f1aeb 100644 --- a/regression-tests/mixed-type-safety-1.cpp2 +++ b/regression-tests/mixed-type-safety-1.cpp2 @@ -27,6 +27,8 @@ print: ( msg: std::string, b: bool ) = main: () -> int = { + // Full qualification is necessary to avoid ambiguity in C++23 + // C++23 defines std::print, which would be picked up here by ADL ::print( "1.1 is int? ", 1.1 is int ); ::print( "1 is int? ", 1 is int ); diff --git a/regression-tests/pure2-type-safety-1.cpp2 b/regression-tests/pure2-type-safety-1.cpp2 index 263e39be5..11734de99 100644 --- a/regression-tests/pure2-type-safety-1.cpp2 +++ b/regression-tests/pure2-type-safety-1.cpp2 @@ -23,6 +23,8 @@ main: () -> int = test_generic: ( x, msg ) = { msgx: std::string = msg; + // Full qualification is necessary to avoid ambiguity in C++23 + // C++23 defines std::print, which would be picked up here by ADL ::print( msgx + " is int? ", x is int ); } diff --git a/regression-tests/test-results/mixed-type-safety-1.cpp b/regression-tests/test-results/mixed-type-safety-1.cpp index e9b1058dc..59c67ac87 100644 --- a/regression-tests/test-results/mixed-type-safety-1.cpp +++ b/regression-tests/test-results/mixed-type-safety-1.cpp @@ -56,6 +56,8 @@ auto print(cpp2::impl::in msg, cpp2::impl::in b) -> void #line 28 "mixed-type-safety-1.cpp2" [[nodiscard]] auto main() -> int { + // Full qualification is necessary to avoid ambiguity in C++23 + // C++23 defines std::print, which would be picked up here by ADL ::print("1.1 is int? ", cpp2::impl::is(1.1)); ::print( "1 is int? ", cpp2::impl::is(1)); diff --git a/regression-tests/test-results/pure2-type-safety-1.cpp b/regression-tests/test-results/pure2-type-safety-1.cpp index 138f3ef54..10d7e38c9 100644 --- a/regression-tests/test-results/pure2-type-safety-1.cpp +++ b/regression-tests/test-results/pure2-type-safety-1.cpp @@ -19,9 +19,9 @@ #line 24 "pure2-type-safety-1.cpp2" auto test_generic(auto const& x, auto const& msg) -> void; -#line 29 "pure2-type-safety-1.cpp2" +#line 31 "pure2-type-safety-1.cpp2" auto print(cpp2::impl::in msg, cpp2::impl::in b) -> void; -#line 35 "pure2-type-safety-1.cpp2" +#line 37 "pure2-type-safety-1.cpp2" #line 1 "pure2-type-safety-1.cpp2" @@ -55,10 +55,12 @@ auto print(cpp2::impl::in msg, cpp2::impl::in b) -> void; #line 24 "pure2-type-safety-1.cpp2" auto test_generic(auto const& x, auto const& msg) -> void{ std::string msgx {msg}; + // Full qualification is necessary to avoid ambiguity in C++23 + // C++23 defines std::print, which would be picked up here by ADL ::print(cpp2::move(msgx) + " is int? ", cpp2::impl::is(x)); } -#line 29 "pure2-type-safety-1.cpp2" +#line 31 "pure2-type-safety-1.cpp2" auto print(cpp2::impl::in msg, cpp2::impl::in b) -> void{ cpp2::impl::deferred_init bmsg; if (b) { bmsg.construct("true");}