Skip to content

Commit 325c9b7

Browse files
clean more
1 parent a563260 commit 325c9b7

File tree

1 file changed

+1
-93
lines changed

1 file changed

+1
-93
lines changed

libcxx/include/__tree

Lines changed: 1 addition & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,99 +1886,7 @@ pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
18861886
bool __inserted = false;
18871887
if (__child == nullptr) {
18881888
__node_holder __h = __construct_node(std::forward<_Args>(__args)...);
1889-
1890-
/*
1891-
error: cannot convert
1892-
'__node_holder'
1893-
(aka
1894-
' unique_ptr<
1895-
__tree_node<
1896-
std::__value_type<int, double>,
1897-
min_pointer<void, std::integral_constant<unsigned long, 0> >
1898-
>,
1899-
__tree_node_destructor<
1900-
min_allocator<
1901-
std::__tree_node<
1902-
std::__value_type<int, double>,
1903-
min_pointer<void, std::integral_constant<unsigned long, 0> >
1904-
>
1905-
>
1906-
>
1907-
>
1908-
'
1909-
)
1910-
to 'double' without a conversion operator
1911-
*/
1912-
// double d2 =static_cast<double>(__h);
1913-
// (void)d2;
1914-
1915-
/*
1916-
error: cannot convert 'pointer'
1917-
(aka
1918-
' min_pointer<
1919-
std::__tree_node<
1920-
std::__value_type<int, double>,
1921-
min_pointer<void, std::integral_constant<unsigned long, 0>>
1922-
>
1923-
>
1924-
') to 'double' without a conversion operator
1925-
*/
1926-
// double d =static_cast<double>(__h.get());
1927-
// (void)d;
1928-
1929-
/*
1930-
error: cannot convert '__node_base_pointer' (aka
1931-
' min_pointer<
1932-
std::__tree_node_base<
1933-
min_pointer<void, std::integral_constant<unsigned long, 0>>
1934-
>,
1935-
std::integral_constant<unsigned long, 0>
1936-
>
1937-
') to 'double' without a conversion operator
1938-
*/
1939-
1940-
// __node_base_pointer xxx = nullptr;
1941-
// (void)xxx;
1942-
// double d3 =static_cast<double>(xxx);
1943-
// (void)d3;
1944-
1945-
// __node_base_pointer __foo = static_cast<__node_base_pointer>(__h.get());
1946-
// (void)__foo;
1947-
// __maybe_unused__ __node_base_pointer __foo2 = __node_base_pointer(__h.get());
1948-
1949-
/*
1950-
error: cannot convert '__tree<std::__value_type<int, double>, std::__map_value_compare<int, std::pair<const int,
1951-
double>, std::less<int>, true>, min_allocator<std::pair<const int, double>>>::__node_holder' (aka
1952-
'unique_ptr<__tree_node<std::__value_type<int, double>, min_pointer<void, std::integral_constant<unsigned long,
1953-
0>>>, __tree_node_destructor<min_allocator<std::__tree_node<std::__value_type<int, double>, min_pointer<void,
1954-
std::integral_constant<unsigned long, 0>>>>>>') to 'double' without a conversion operator
1955-
*/
1956-
// __tree<_Tp, _Compare, _Allocator>::__node_holder __tmp_nh;
1957-
// double __xxx = static_cast<double>(__tmp_nh);
1958-
1959-
/*
1960-
error: cannot convert 'pointer' (aka 'min_pointer<std::__tree_node<std::__value_type<int, double>, min_pointer<void,
1961-
std::integral_constant<unsigned long, 0>>>>') to 'double' without a conversion operator
1962-
*/
1963-
// __tree<_Tp, _Compare, _Allocator>::__node_holder __tmp_nh;
1964-
// double __xxx = static_cast<double>(__tmp_nh.get());
1965-
1966-
/*
1967-
note:
1968-
cast from 'void *' is not allowed in a constant expression
1969-
because the pointed object type
1970-
'std::__tree_node<std::__value_type<int, double>, min_pointer<void>>'
1971-
is not similar to the target type
1972-
'std::__tree_node_base<min_pointer<void>>'
1973-
*/
1974-
1975-
// TODO: collapse into one branch
1976-
if (__libcpp_is_constant_evaluated()) {
1977-
__insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__h.get()));
1978-
} else {
1979-
__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
1980-
}
1981-
1889+
__insert_node_at(__parent, __child, std::__static_fancy_pointer_cast<__node_base_pointer>(__h.get()));
19821890
__r = __h.release();
19831891
__inserted = true;
19841892
}

0 commit comments

Comments
 (0)