Skip to content

Commit 0e8798f

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:e86d6a43f03b into amd-gfx:caaa027161c5
Local branch amd-gfx caaa027 Merged main:1964118ace49 into amd-gfx:a0a17ac92a9a Remote branch main e86d6a4 Regenerate test checks for tests affected by D141060
2 parents caaa027 + e86d6a4 commit 0e8798f

File tree

49 files changed

+2347
-1376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2347
-1376
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,11 @@ Bug Fixes to C++ Support
435435
we now produce a diagnostic. Fixes:
436436
(`#65522 <https://github.com/llvm/llvm-project/issues/65522>`_)
437437

438+
- Fixed a bug where clang incorrectly considered implicitly generated deduction
439+
guides from a non-templated constructor and a templated constructor as ambiguous,
440+
rather than prefer the non-templated constructor as specified in
441+
[standard.group]p3.
442+
438443
Bug Fixes to AST Handling
439444
^^^^^^^^^^^^^^^^^^^^^^^^^
440445
- Fixed an import failure of recursive friend class template.

clang/lib/Sema/SemaOverload.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10440,6 +10440,21 @@ bool clang::isBetterOverloadCandidate(
1044010440
// -- F1 is the copy deduction candidate(16.3.1.8) and F2 is not
1044110441
if (Guide1->getDeductionCandidateKind() == DeductionCandidate::Copy)
1044210442
return true;
10443+
if (Guide2->getDeductionCandidateKind() == DeductionCandidate::Copy)
10444+
return false;
10445+
10446+
// --F1 is generated from a non-template constructor and F2 is generated
10447+
// from a constructor template
10448+
const auto *Constructor1 = Guide1->getCorrespondingConstructor();
10449+
const auto *Constructor2 = Guide2->getCorrespondingConstructor();
10450+
if (Constructor1 && Constructor2) {
10451+
bool isC1Templated = Constructor1->getTemplatedKind() !=
10452+
FunctionDecl::TemplatedKind::TK_NonTemplate;
10453+
bool isC2Templated = Constructor2->getTemplatedKind() !=
10454+
FunctionDecl::TemplatedKind::TK_NonTemplate;
10455+
if (isC1Templated != isC2Templated)
10456+
return isC2Templated;
10457+
}
1044310458
}
1044410459
}
1044510460

@@ -10483,7 +10498,7 @@ bool clang::isBetterOverloadCandidate(
1048310498
if (AS1 != AS2) {
1048410499
if (Qualifiers::isAddressSpaceSupersetOf(AS2, AS1))
1048510500
return true;
10486-
if (Qualifiers::isAddressSpaceSupersetOf(AS2, AS1))
10501+
if (Qualifiers::isAddressSpaceSupersetOf(AS1, AS2))
1048710502
return false;
1048810503
}
1048910504
}

clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2140,7 +2140,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(
21402140
Function = CXXDeductionGuideDecl::Create(
21412141
SemaRef.Context, DC, D->getInnerLocStart(),
21422142
InstantiatedExplicitSpecifier, NameInfo, T, TInfo,
2143-
D->getSourceRange().getEnd(), /*Ctor=*/nullptr,
2143+
D->getSourceRange().getEnd(), DGuide->getCorrespondingConstructor(),
21442144
DGuide->getDeductionCandidateKind());
21452145
Function->setAccess(D->getAccess());
21462146
} else {

clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p2.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,38 @@ int main() {
8585

8686

8787
}
88+
89+
namespace deduceTemplatedConstructor {
90+
template <typename X, typename Y> struct IsSame {
91+
static constexpr bool value = false;
92+
};
93+
94+
template <typename Z> struct IsSame<Z, Z> {
95+
static constexpr bool value = true;
96+
};
97+
template <class T> struct A {
98+
using value_type = T;
99+
A(value_type);
100+
A(const A&);
101+
A(T, T, int);
102+
template<class U>
103+
A(int, T, U);
104+
};
105+
106+
A x(1, 2, 3); // no-error
107+
static_assert(IsSame<decltype(x),A<int>>::value);
108+
109+
template <class T>
110+
A(T) -> A<T>;
111+
112+
A a(42);
113+
static_assert(IsSame<decltype(a),A<int>>::value);
114+
A b = a;
115+
static_assert(IsSame<decltype(b),A<int>>::value);
116+
117+
template <class T>
118+
A(A<T>) -> A<A<T>>;
119+
120+
A b2 = a;
121+
static_assert(IsSame<decltype(b2),A<A<int>>>::value);
122+
}

libcxx/include/__algorithm/pstl_backend.h

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,25 @@ A PSTL parallel backend is a tag type to which the following functions are assoc
3535
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Comp>
3636
void __pstl_stable_sort(_Backend, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp);
3737
38+
template <class _ExecutionPolicy,
39+
class _ForwardIterator1,
40+
class _ForwardIterator2,
41+
class _ForwardOutIterator,
42+
class _Comp>
43+
_ForwardOutIterator __pstl_merge(_Backend,
44+
_ForwardIterator1 __first1,
45+
_ForwardIterator1 __last1,
46+
_ForwardIterator2 __first2,
47+
_ForwardIterator2 __last2,
48+
_ForwardOutIterator __result,
49+
_Comp __comp);
50+
3851
template <class _ExecutionPolicy, class _InIterator, class _OutIterator, class _UnaryOperation>
39-
_OutIterator __pstl_transform(_InIterator __first, _InIterator __last, _OutIterator __result, _UnaryOperation __op);
52+
_OutIterator __pstl_transform(_Backend, _InIterator __first, _InIterator __last, _OutIterator __result, _UnaryOperation __op);
4053
4154
template <class _ExecutionPolicy, class _InIterator1, class _InIterator2, class _OutIterator, class _BinaryOperation>
42-
_OutIterator __pstl_transform(_InIterator1 __first1,
55+
_OutIterator __pstl_transform(_Backend,
56+
_InIterator1 __first1,
4357
_InIterator1 __last1,
4458
_InIterator2 __first2,
4559
_OutIterator __result,

lldb/include/lldb/Utility/XcodeSDK.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class XcodeSDK {
6969

7070
XcodeSDK &operator=(const XcodeSDK &other);
7171
XcodeSDK(const XcodeSDK&) = default;
72-
bool operator==(const XcodeSDK &other);
72+
bool operator==(const XcodeSDK &other) const;
7373

7474
/// Return parsed SDK type and version number.
7575
Info Parse() const;

lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,8 @@ void DynamicLoaderDarwinKernel::KextImageInfo::SetProcessStopId(
606606
m_load_process_stop_id = stop_id;
607607
}
608608

609-
bool DynamicLoaderDarwinKernel::KextImageInfo::
610-
operator==(const KextImageInfo &rhs) {
609+
bool DynamicLoaderDarwinKernel::KextImageInfo::operator==(
610+
const KextImageInfo &rhs) const {
611611
if (m_uuid.IsValid() || rhs.GetUUID().IsValid()) {
612612
return m_uuid == rhs.GetUUID();
613613
}

lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class DynamicLoaderDarwinKernel : public lldb_private::DynamicLoader {
176176

177177
void SetProcessStopId(uint32_t stop_id);
178178

179-
bool operator==(const KextImageInfo &rhs);
179+
bool operator==(const KextImageInfo &rhs) const;
180180

181181
uint32_t GetAddressByteSize(); // as determined by Mach-O header
182182

lldb/source/Utility/XcodeSDK.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ XcodeSDK::XcodeSDK(XcodeSDK::Info info) : m_name(GetName(info.type).str()) {
5656

5757
XcodeSDK &XcodeSDK::operator=(const XcodeSDK &other) = default;
5858

59-
bool XcodeSDK::operator==(const XcodeSDK &other) {
59+
bool XcodeSDK::operator==(const XcodeSDK &other) const {
6060
return m_name == other.m_name;
6161
}
6262

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 476770
19+
#define LLVM_MAIN_REVISION 476779
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

0 commit comments

Comments
 (0)