Skip to content

Commit 1488d45

Browse files
committed
CI Fix a C++23 template specialization issue
1 parent 8521e0c commit 1488d45

File tree

8 files changed

+12
-304
lines changed

8 files changed

+12
-304
lines changed

regression-tests/mixed-type-safety-1.cpp2

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ print: <T : type> ( msg: std::string, x: T ) =
1414

1515
main: () -> int =
1616
{
17-
print( "1.1 is int?", 1.1 is int );
18-
print( "1 is int?", 1 is int );
17+
::print( "1.1 is int?", 1.1 is int );
18+
::print( "1 is int?", 1 is int );
1919

2020
c := new<Circle>(); // safe by construction
2121
s : * Shape = c.get(); // safe by Lifetime
22-
print("\ns* is Shape? ", s* is Shape );
23-
print( "s* is Circle?", s* is Circle );
24-
print( "s* is Square?", s* is Square );
22+
::print("\ns* is Shape? ", s* is Shape );
23+
::print( "s* is Circle?", s* is Circle );
24+
::print( "s* is Square?", s* is Square );
2525
}

regression-tests/pure2-type-safety-1.cpp2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ main: () -> int =
2323

2424
test_generic: ( x, msg ) = {
2525
msgx: std::string = msg;
26-
print( msgx + " is int? ", x is int );
26+
::print( msgx + " is int? ", x is int );
2727
}
2828

2929
print: ( msg: std::string, b: bool ) = {

regression-tests/test-results/clang-18-c++23-libcpp/mixed-type-safety-1.cpp.output

Lines changed: 0 additions & 239 deletions
This file was deleted.

regression-tests/test-results/clang-18-c++23-libcpp/pure2-type-safety-1.cpp.output

Lines changed: 0 additions & 25 deletions
This file was deleted.

regression-tests/test-results/gcc-14-c++2b/pure2-type-safety-1.cpp.output

Lines changed: 0 additions & 16 deletions
This file was deleted.

regression-tests/test-results/mixed-type-safety-1.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ template<typename T> auto print(cpp2::impl::in<std::string> msg, T const& x) ->
3838
#line 15 "mixed-type-safety-1.cpp2"
3939
[[nodiscard]] auto main() -> int
4040
{
41-
print("1.1 is int?", cpp2::impl::is<int>(1.1));
42-
print( "1 is int?", cpp2::impl::is<int>(1));
41+
::print("1.1 is int?", cpp2::impl::is<int>(1.1));
42+
::print( "1 is int?", cpp2::impl::is<int>(1));
4343

4444
auto c {cpp2_new<Circle>()}; // safe by construction
4545
Shape* s {CPP2_UFCS(get)(cpp2::move(c))}; // safe by Lifetime
46-
print("\ns* is Shape? ", cpp2::impl::is<Shape>(*cpp2::impl::assert_not_null(s)));
47-
print( "s* is Circle?", cpp2::impl::is<Circle>(*cpp2::impl::assert_not_null(s)));
48-
print( "s* is Square?", cpp2::impl::is<Square>(*cpp2::impl::assert_not_null(cpp2::move(s))));
46+
::print("\ns* is Shape? ", cpp2::impl::is<Shape>(*cpp2::impl::assert_not_null(s)));
47+
::print( "s* is Circle?", cpp2::impl::is<Circle>(*cpp2::impl::assert_not_null(s)));
48+
::print( "s* is Square?", cpp2::impl::is<Square>(*cpp2::impl::assert_not_null(cpp2::move(s))));
4949
}
50-
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1 @@
11
pure2-type-safety-1.cpp
2-
pure2-type-safety-1.cpp2(26): error C2666: 'print': overloaded functions have similar conversions
3-
pure2-type-safety-1.cpp2(29): note: could be 'void print(const std::string &,const bool)'
4-
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\include\print(125): note: or 'void std::print<std::false_type>(const std::basic_format_string<char,std::integral_constant<bool,false>>,std::false_type &&)' [found using argument-dependent lookup]
5-
pure2-type-safety-1.cpp2(26): note: while trying to match the argument list '(std::basic_string<char,std::char_traits<char>,std::allocator<char>>, std::false_type)'
6-
pure2-type-safety-1.cpp2(26): note: the template instantiation context (the oldest one first) is
7-
pure2-type-safety-1.cpp2(8): note: see reference to function template instantiation 'void test_generic<double,char[7]>(const _T0 &,const _T1 (&))' being compiled
8-
with
9-
[
10-
_T0=double,
11-
_T1=char [7]
12-
]

regression-tests/test-results/pure2-type-safety-1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ auto print(cpp2::impl::in<std::string> msg, cpp2::impl::in<bool> b) -> void;
5555
#line 24 "pure2-type-safety-1.cpp2"
5656
auto test_generic(auto const& x, auto const& msg) -> void{
5757
std::string msgx {msg};
58-
print(cpp2::move(msgx) + " is int? ", cpp2::impl::is<int>(x));
58+
::print(cpp2::move(msgx) + " is int? ", cpp2::impl::is<int>(x));
5959
}
6060

6161
#line 29 "pure2-type-safety-1.cpp2"

0 commit comments

Comments
 (0)