forked from OSchip/llvm-project
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:
parent
0077b22aa4
commit
dfbdfbba8f
|
@ -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 { };
|
||||
|
|
Loading…
Reference in New Issue