Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
07e8828
[Clang][WIP][RFC] Bypass TAD during overload resolution if a perfect …
cor3ntin Mar 27, 2025
d35cfbb
avoid comparing types
cor3ntin Mar 29, 2025
297109c
Fix logic
cor3ntin Mar 29, 2025
f1b0454
optimize
cor3ntin Mar 29, 2025
31ad232
optimize again
cor3ntin Mar 29, 2025
f57291b
Cleanups, fix tests
cor3ntin Mar 31, 2025
bade63f
Fix templight test
cor3ntin Mar 31, 2025
a134656
format
cor3ntin Mar 31, 2025
057b935
do not skip templates when initializing by constructors as that might…
cor3ntin Mar 31, 2025
721f26c
move and document the special handling of implicit object member func…
cor3ntin Mar 31, 2025
a21bc4d
Fix typos and cuda tests
cor3ntin Mar 31, 2025
b205be1
remove redundant check
cor3ntin Mar 31, 2025
af22b19
More code simplification
cor3ntin Apr 1, 2025
42e8795
fix cuda, add comments
cor3ntin Apr 1, 2025
03c157a
add tests
cor3ntin Apr 1, 2025
0709939
* Fix handling of explicit specifiers
cor3ntin Apr 1, 2025
a02299e
slab allocate template candidates
cor3ntin Apr 3, 2025
8ee938c
fix rvalue to lvalue binding
cor3ntin Apr 3, 2025
bcf08f5
Disable resolution by perfect match when
cor3ntin Apr 3, 2025
8aee255
address Erich's, format, add release notes
cor3ntin Apr 15, 2025
6edcb65
address more of Erich's feedback
cor3ntin Apr 15, 2025
7b0c9c6
Clarify changelog
cor3ntin Apr 15, 2025
c621548
fix assertion
cor3ntin Apr 15, 2025
cfecf5a
cleanups
cor3ntin Apr 16, 2025
8004549
fix assertion
cor3ntin Apr 16, 2025
14e0515
Cleaner approach
cor3ntin Apr 16, 2025
d4db7e6
Add comment
cor3ntin Apr 16, 2025
02db83a
Add asserts
cor3ntin Apr 16, 2025
17cbd62
fix missplaced assert
cor3ntin Apr 16, 2025
b1ce5e7
typo
cor3ntin Apr 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion clang/lib/Sema/SemaInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5231,7 +5231,7 @@ static OverloadingResult TryRefInitWithConversionFunction(

// Add the final conversion sequence, if necessary.
if (NewRefRelationship == Sema::Ref_Incompatible) {
assert(!isa<CXXConstructorDecl>(Function) &&
assert(Best->HasFinalConversion && !isa<CXXConstructorDecl>(Function) &&
"should not have conversion after constructor");

ImplicitConversionSequence ICS;
Expand Down Expand Up @@ -6200,6 +6200,7 @@ static void TryUserDefinedConversion(Sema &S,

// If the conversion following the call to the conversion function
// is interesting, add it as a separate step.
assert(Best->HasFinalConversion);
if (Best->FinalConversion.First || Best->FinalConversion.Second ||
Best->FinalConversion.Third) {
ImplicitConversionSequence ICS;
Expand Down
6 changes: 6 additions & 0 deletions clang/lib/Sema/SemaOverload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4079,6 +4079,9 @@ IsUserDefinedConversion(Sema &S, Expr *From, QualType ToType,
}
if (CXXConversionDecl *Conversion
= dyn_cast<CXXConversionDecl>(Best->Function)) {

assert(Best->HasFinalConversion);

// C++ [over.ics.user]p1:
//
// [...] If the user-defined conversion is specified by a
Expand Down Expand Up @@ -5175,6 +5178,7 @@ FindConversionForRefInit(Sema &S, ImplicitConversionSequence &ICS,
if (!Best->FinalConversion.DirectBinding)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this 'if' here? Assert probably needs to be above this.

return false;

assert(Best->HasFinalConversion);
ICS.setUserDefined();
ICS.UserDefined.Before = Best->Conversions[0].Standard;
ICS.UserDefined.After = Best->FinalConversion;
Expand Down Expand Up @@ -10758,6 +10762,8 @@ bool clang::isBetterOverloadCandidate(
Cand1.Function && Cand2.Function &&
isa<CXXConversionDecl>(Cand1.Function) &&
isa<CXXConversionDecl>(Cand2.Function)) {

assert(Cand1.HasFinalConversion && Cand2.HasFinalConversion);
// First check whether we prefer one of the conversion functions over the
// other. This only distinguishes the results in non-standard, extension
// cases such as the conversion from a lambda closure type to a function
Expand Down
Loading