mirror of
https://github.com/intel/llvm.git
synced 2026-01-27 06:06:34 +08:00
In Sema's TryRefInitWithConversionFunction, suppress user conversions for the overload candidates.
Fixes an infinite recursion in overload resolution for rdar://8499524. Many thanks to Doug! llvm-svn: 115588
This commit is contained in:
@@ -2325,10 +2325,12 @@ static OverloadingResult TryRefInitWithConversionFunction(Sema &S,
|
||||
if (ConstructorTmpl)
|
||||
S.AddTemplateOverloadCandidate(ConstructorTmpl, FoundDecl,
|
||||
/*ExplicitArgs*/ 0,
|
||||
&Initializer, 1, CandidateSet);
|
||||
&Initializer, 1, CandidateSet,
|
||||
/*SuppressUserConversions=*/true);
|
||||
else
|
||||
S.AddOverloadCandidate(Constructor, FoundDecl,
|
||||
&Initializer, 1, CandidateSet);
|
||||
&Initializer, 1, CandidateSet,
|
||||
/*SuppressUserConversions=*/true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
|
||||
struct Base { }; // expected-note{{candidate is the implicit copy constructor}}
|
||||
struct Base { };
|
||||
struct Derived : Base { }; // expected-note{{candidate constructor (the implicit copy constructor) not viable}}
|
||||
struct Unrelated { };
|
||||
struct Derived2 : Base { };
|
||||
|
||||
Reference in New Issue
Block a user