Skip to content

Commit 7a994cf

Browse files
committed
Add comment about non-canonical FunctionDecls
1 parent fbee42a commit 7a994cf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang/lib/Sema/SemaOverload.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4404,6 +4404,10 @@ CompareImplicitConversionSequences(Sema &S, SourceLocation Loc,
44044404
Result = CompareStandardConversionSequences(S, Loc,
44054405
ICS1.Standard, ICS2.Standard);
44064406
else if (ICS1.isUserDefined()) {
4407+
// With lazy template loading, it is possible to find non-canonical
4408+
// FunctionDecls, depending on when redecl chains are completed. Make sure
4409+
// to compare the canonical decls of conversion functions. This avoids
4410+
// ambiguity problems for templated conversion operators.
44074411
const FunctionDecl *ConvFunc1 = ICS1.UserDefined.ConversionFunction;
44084412
if (ConvFunc1)
44094413
ConvFunc1 = ConvFunc1->getCanonicalDecl();

0 commit comments

Comments
 (0)