Skip to content

Commit ec9ab9d

Browse files
committed
Merge tag 'llvmorg-22.1.7' into rustc/22.1-2026-05-19
LLVM 22.1.7
2 parents 08c84e6 + a255c1e commit ec9ab9d

35 files changed

Lines changed: 742 additions & 828 deletions

File tree

clang/lib/AST/StmtProfile.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2369,7 +2369,26 @@ void StmtProfiler::VisitMaterializeTemporaryExpr(
23692369
}
23702370

23712371
void StmtProfiler::VisitCXXFoldExpr(const CXXFoldExpr *S) {
2372-
VisitExpr(S);
2372+
VisitStmtNoChildren(S);
2373+
// The callee sub-expression is not part of how the expression is written,
2374+
// so it's not added to the profile.
2375+
//
2376+
// Example:
2377+
// template <typename... T> requires ((sizeof(T) > 0) && ...) void f() {}
2378+
// class A;
2379+
// void operator&&(A, A);
2380+
// template <typename... T> requires ((sizeof(T) > 0) && ...) void f() {}
2381+
//
2382+
// Both definitions have identically written fold expressions, but semantic
2383+
// analysis adds the overloaded operator to the second one.
2384+
if (S->getLHS())
2385+
Visit(S->getLHS());
2386+
else
2387+
ID.AddInteger(0);
2388+
if (S->getRHS())
2389+
Visit(S->getRHS());
2390+
else
2391+
ID.AddInteger(0);
23732392
ID.AddInteger(S->getOperator());
23742393
}
23752394

clang/test/Modules/polluted-operator.cppm

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

clang/test/SemaCXX/GH190333.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
2+
3+
template <typename... T> requires ((sizeof(T) > 0) && ...) void f() {} // expected-note{{previous definition is here}}
4+
class A;
5+
void operator&&(A, A);
6+
template <typename... T> requires ((sizeof(T) > 0) && ...) void f() {} // expected-error{{redefinition of 'f'}}

clang/tools/libclang/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ if (MSVC AND ENABLE_SHARED AND ENABLE_STATIC)
120120
unset(ENABLE_STATIC)
121121
endif()
122122

123-
if(MSVC)
123+
if(WIN32 AND NOT MINGW)
124124
set(output_name "libclang")
125125
else()
126126
set(output_name "clang")

cmake/Modules/LLVMVersion.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if(NOT DEFINED LLVM_VERSION_MINOR)
77
set(LLVM_VERSION_MINOR 1)
88
endif()
99
if(NOT DEFINED LLVM_VERSION_PATCH)
10-
set(LLVM_VERSION_PATCH 6)
10+
set(LLVM_VERSION_PATCH 7)
1111
endif()
1212
if(NOT DEFINED LLVM_VERSION_SUFFIX)
1313
set(LLVM_VERSION_SUFFIX)

libc/cmake/modules/prepare_libc_gpu_build.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ endif()
77
set(req_ver "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
88
if(LLVM_VERSION_MAJOR AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang" AND
99
${CMAKE_CXX_COMPILER_VERSION} VERSION_EQUAL "${req_ver}"))
10-
message(FATAL_ERROR "Cannot build libc for GPU. CMake compiler "
10+
message(WARNING "libc for GPU requires an up-to-date clang. CMake compiler "
1111
"'${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}' "
1212
" is not 'Clang ${req_ver}'.")
1313
endif()

libcxx/include/__config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
// _LIBCPP_VERSION represents the version of libc++, which matches the version of LLVM.
3131
// Given a LLVM release LLVM XX.YY.ZZ (e.g. LLVM 17.0.1 == 17.00.01), _LIBCPP_VERSION is
3232
// defined to XXYYZZ.
33-
# define _LIBCPP_VERSION 220106
33+
# define _LIBCPP_VERSION 220107
3434

3535
# define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
3636
# define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)

libcxx/include/__tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,8 +2026,8 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(const_iterator __
20262026
template <class _Tp, class _Compare, class _Allocator>
20272027
template <class _NodeHandle>
20282028
_LIBCPP_HIDE_FROM_ABI _NodeHandle __tree<_Tp, _Compare, _Allocator>::__node_handle_extract(key_type const& __key) {
2029-
iterator __it = find(__key);
2030-
if (__it == end())
2029+
iterator __it = __lower_bound_multi(__key);
2030+
if (__it == end() || __value_comp_(__key, *__it))
20312031
return _NodeHandle();
20322032
return __node_handle_extract<_NodeHandle>(__it);
20332033
}

libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_key.pass.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@ int main(int, char**) {
5050
test(m, std::begin(keys), std::end(keys));
5151
}
5252

53+
{ // Check that the first element is returned
54+
std::multimap<int, int> m = {{1, 1}, {1, 2}, {1, 3}};
55+
auto ptr = std::addressof(m.begin()->first);
56+
auto res = m.extract(1);
57+
assert(std::addressof(res.key()) == ptr);
58+
}
59+
60+
{ // Check that no element is returned if there is no match
61+
std::multimap<int, int> m = {{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}};
62+
auto res = m.extract(0);
63+
assert(!res);
64+
}
65+
5366
{
5467
std::multimap<Counter<int>, Counter<int>> m = {{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}};
5568
{

libcxx/test/std/containers/associative/multiset/extract_key.pass.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ int main(int, char**) {
4848
test(m, std::begin(keys), std::end(keys));
4949
}
5050

51+
{ // Check that the first element is returned
52+
std::multiset<int> m = {1, 1, 1};
53+
auto ptr = std::addressof(*m.begin());
54+
auto res = m.extract(1);
55+
assert(std::addressof(res.value()) == ptr);
56+
}
57+
58+
{ // Check that no element is returned if there is no match
59+
std::multiset<int> m = {1, 2, 3};
60+
auto res = m.extract(0);
61+
assert(!res);
62+
}
63+
5164
{
5265
std::multiset<Counter<int>> m = {1, 2, 3, 4, 5, 6};
5366
{

0 commit comments

Comments
 (0)