<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 14 February 2017 at 19:48, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-">On 14 February 2017 at 18:14, Akira Hatanaka <span dir="ltr"><<a href="mailto:ahatanaka@apple.com" target="_blank">ahatanaka@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">Hi Richard,<div><br></div><div>It looks like this commit causes an assertion failure when the following code is compiled:</div><div><br></div><div>$ cat test1.cpp</div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">template<class T></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">struct S3 {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">};</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">template<class T></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">struct S2 {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">  S2(S3<T> &&);</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">};</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">template<class T></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">struct S1 : S2<T> {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">  using S2<T>::S2;</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">  S1();</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">};</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">template<class T></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">struct S0 {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">  S0();</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">  S0(S0&&) = default;</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">  S1<T> m1;</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">};</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">void foo1() {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">  S0<int> s0;</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">}</span></div></div><div><br></div><div>$ <span style="font-family:menlo;font-size:11px;background-color:rgb(255,255,255)">clang++</span><span style="font-family:menlo;font-size:11px;background-color:rgb(255,255,255)">  </span><span style="font-family:menlo;font-size:11px;background-color:rgb(255,255,255)">-std=c++1z test1.cpp -c -o /dev/null</span></div><div><span style="font-family:menlo;font-size:11px;background-color:rgb(255,255,255)"><br></span></div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">Assertion failed: (Loc.isValid() && "point of instantiation must be valid!"),</span></div></div><div><br></div><div>What’s the right way to fix this?</div></div></blockquote><div><br></div></span><div>We should figure out where the invalid source location is coming from and pass in a correct location. My current suspicion is the SourceLocation()s in Sema::LookupSpecialMember.</div></div></div></div></blockquote><div><br></div><div>I fixed those in r295149; the above code no longer asserts.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="gmail-h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>The patch I have now just checks whether PointOfInstantiation.isValid() returns true before calling Spec->setPointOfInstantiation at SemaTemplateInstantiate.cpp:19<wbr>38.</div><div><div class="gmail-m_5358068315115869662gmail-h5"><div><br><div><blockquote type="cite"><div>On Jan 13, 2017, at 12:46 PM, Richard Smith via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:</div><br class="gmail-m_5358068315115869662gmail-m_-7609968974156969520Apple-interchange-newline"><div><div>Author: rsmith<br>Date: Fri Jan 13 14:46:54 2017<br>New Revision: 291955<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=291955&view=rev" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=291955&view=rev</a><br>Log:<br>PR31606: Generalize our tentative DR resolution for inheriting copy/move<br>constructors to better match the pre-P0136R1 behavior.<br><br>Modified:<br> Â Â Â cfe/trunk/include/clang/Bas<wbr>ic/DiagnosticSemaKinds.td<br> Â Â Â cfe/trunk/lib/Sema/SemaOver<wbr>load.cpp<br> Â Â Â cfe/trunk/test/CXX/dcl.dcl/<wbr>basic.namespace/namespace.udec<wbr>l/p15.cpp<br> Â Â Â cfe/trunk/test/CXX/dcl.decl<wbr>/dcl.init/dcl.init.aggr/p1.cpp<br> Â Â Â cfe/trunk/test/CXX/drs/dr16<wbr>xx.cpp<br> Â Â Â cfe/trunk/test/CXX/drs/dr19<wbr>xx.cpp<br> Â Â Â cfe/trunk/test/CXX/special/<wbr>class.inhctor/p1.cpp<br> Â Â Â cfe/trunk/test/CXX/special/<wbr>class.inhctor/p3.cpp<br> Â Â Â cfe/trunk/test/CXX/special/<wbr>class.inhctor/p7.cpp<br> Â Â Â cfe/trunk/test/SemaCXX/cxx1<wbr>1-inheriting-ctors.cpp<br> Â Â Â cfe/trunk/test/SemaTemplate<wbr>/cxx1z-using-declaration.cpp<br><br>Modified: cfe/trunk/include/clang/Basic/<wbr>DiagnosticSemaKinds.td<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=291955&r1=291954&r2=291955&view=diff" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/include/clang/<wbr>Basic/DiagnosticSemaKinds.td?<wbr>rev=291955&r1=291954&r2=<wbr>291955&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- cfe/trunk/include/clang/Basic/<wbr>DiagnosticSemaKinds.td (original)<br>+++ cfe/trunk/include/clang/Basic/<wbr>DiagnosticSemaKinds.td Fri Jan 13 14:46:54 2017<br>@@ -3344,8 +3344,8 @@ def note_ovl_candidate : Note<"candidate<br> def note_ovl_candidate_inherited_c<wbr>onstructor : Note<<br> Â Â Â Â "constructor from base class %0 inherited here">;<br> def note_ovl_candidate_inherited_c<wbr>onstructor_slice : Note<<br>- Â Â Â "constructor inherited from base class cannot be used to initialize from "<br>- Â Â Â "an argument of the derived class type">;<br>+ Â Â Â "candidate %select{constructor|template}0 ignored: "<br>+ Â Â Â "inherited constructor cannot be used to %select{copy|move}1 object">;<br> def note_ovl_candidate_illegal_con<wbr>structor : Note<<br> Â Â Â Â "candidate %select{constructor|template}0 ignored: "<br> Â Â Â Â "instantiation %select{takes|would take}0 its own class type by value">;<br><br>Modified: cfe/trunk/lib/Sema/SemaOverloa<wbr>d.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=291955&r1=291954&r2=291955&view=diff" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/lib/Sema/SemaO<wbr>verload.cpp?rev=291955&r1=<wbr>291954&r2=291955&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- cfe/trunk/lib/Sema/SemaOverloa<wbr>d.cpp (original)<br>+++ cfe/trunk/lib/Sema/SemaOverloa<wbr>d.cpp Fri Jan 13 14:46:54 2017<br>@@ -5944,6 +5944,28 @@ Sema::AddOverloadCandidate(Fun<wbr>ctionDecl<br> Â Â Â Â Â Â Candidate.FailureKind = ovl_fail_illegal_constructor;<br> Â Â Â Â Â Â return;<br> Â Â Â Â }<br>+<br>+ Â Â Â // C++ [over.match.funcs]p8: (proposed DR resolution)<br>+ Â Â Â // Â Â A constructor inherited from class type C that has a first parameter<br>+ Â Â Â // Â Â of type "reference to P" (including such a constructor instantiated<br>+ Â Â Â // Â Â from a template) is excluded from the set of candidate functions when<br>+ Â Â Â // Â Â constructing an object of type cv D if the argument list has exactly<br>+ Â Â Â // Â Â one argument and D is reference-related to P and P is reference-related<br>+ Â Â Â // Â Â to C.<br>+ Â Â Â auto *Shadow = dyn_cast<ConstructorUsingShado<wbr>wDecl>(FoundDecl.getDecl());<br>+ Â Â Â if (Shadow && Args.size() == 1 && Constructor->getNumParams() >= 1 &&<br>+ Â Â Â Â Â Â Â Constructor->getParamDe<wbr>cl(0)->getType()->isReferenceT<wbr>ype()) {<br>+ Â Â Â Â Â QualType P = Constructor->getParamDecl(0)-><wbr>getType()->getPointeeType();<br>+ Â Â Â Â Â QualType C = Context.getRecordType(Construc<wbr>tor->getParent());<br>+ Â Â Â Â Â QualType D = Context.getRecordType(Shadow-><wbr>getParent());<br>+ Â Â Â Â Â SourceLocation Loc = Args.front()->getExprLoc();<br>+ Â Â Â Â Â if ((Context.hasSameUnqualifiedTy<wbr>pe(P, C) || IsDerivedFrom(Loc, P, C)) &&<br>+ Â Â Â Â Â Â Â Â Â (Context.hasSameUnqua<wbr>lifiedType(D, P) || IsDerivedFrom(Loc, D, P))) {<br>+ Â Â Â Â Â Â Â Candidate.Viable = false;<br>+ Â Â Â Â Â Â Â Candidate.FailureKind = ovl_fail_inhctor_slice;<br>+ Â Â Â Â Â Â Â return;<br>+ Â Â Â Â Â }<br>+ Â Â Â }<br> Â Â }<br><br> Â Â unsigned NumParams = Proto->getNumParams();<br>@@ -6016,31 +6038,6 @@ Sema::AddOverloadCandidate(Fun<wbr>ctionDecl<br> Â Â Â Â }<br> Â Â }<br><br>- Â // C++ [over.best.ics]p4+: (proposed DR resolution)<br>- Â // Â Â If the target is the first parameter of an inherited constructor when<br>- Â // Â Â constructing an object of type C with an argument list that has exactly<br>- Â // Â Â one expression, an implicit conversion sequence cannot be formed if C is<br>- Â // Â Â reference-related to the type that the argument would have after the<br>- Â // Â Â application of the user-defined conversion (if any) and before the final<br>- Â // Â Â standard conversion sequence. <br>- Â auto *Shadow = dyn_cast<ConstructorUsingShado<wbr>wDecl>(FoundDecl.getDecl());<br>- Â if (Shadow && Args.size() == 1 && !isa<InitListExpr>(Args.front(<wbr>))) {<br>- Â Â Â bool DerivedToBase, ObjCConversion, ObjCLifetimeConversion;<br>- Â Â Â QualType ConvertedArgumentType = Args.front()->getType();<br>- Â Â Â if (Candidate.Conversions[0].isUs<wbr>erDefined())<br>- Â Â Â Â Â ConvertedArgumentType =<br>- Â Â Â Â Â Â Â Â Â Candidate.Conversions<wbr>[0].UserDefined.After.<wbr>getFromType();<br>- Â Â Â if (CompareReferenceRelationship(<wbr>Args.front()->getLocStart(),<br>- Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <wbr>      Context.getRecordType(Sh<wbr>adow->getParent()),<br>- Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <wbr>      ConvertedArgumentType, DerivedToBase,<br>- Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <wbr>      ObjCConversion,<br>- Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <wbr>      ObjCLifetimeConversion) >= Ref_Related) {<br>- Â Â Â Â Â Candidate.Viable = false;<br>- Â Â Â Â Â Candidate.FailureKind = ovl_fail_inhctor_slice;<br>- Â Â Â Â Â return;<br>- Â Â Â }<br>- Â }<br>-<br> Â Â if (EnableIfAttr *FailedAttr = CheckEnableIf(Function, Args)) {<br> Â Â Â Â Candidate.Viable = false;<br> Â Â Â Â Candidate.FailureKind = ovl_fail_enable_if;<br>@@ -10222,8 +10219,13 @@ static void NoteFunctionCandidate(Sema &<br> Â Â Â Â return DiagnoseOpenCLExtensionDisable<wbr>d(S, Cand);<br><br> Â Â case ovl_fail_inhctor_slice:<br>+ Â Â Â // It's generally not interesting to note copy/move constructors here.<br>+ Â Â Â if (cast<CXXConstructorDecl>(Fn)-<wbr>>isCopyOrMoveConstructor())<br>+ Â Â Â Â Â return;<br> Â Â Â Â S.Diag(Fn->getLocation(),<br>- Â Â Â Â Â Â Â Â Â Â diag::note_ovl_candi<wbr>date_inherited_constructor_<wbr>slice);<br>+ Â Â Â Â Â Â Â Â Â Â diag::note_ovl_candi<wbr>date_inherited_constructor_<wbr>slice)<br>+ Â Â Â Â Â << (Fn->getPrimaryTemplate() ? 1 : 0)<br>+ Â Â Â Â Â << Fn->getParamDecl(0)->getType()<wbr>->isRValueReferenceType();<br> Â Â Â Â MaybeEmitInheritedConstruc<wbr>torNote(S, Cand->FoundDecl);<br> Â Â Â Â return;<br><br><br>Modified: cfe/trunk/test/CXX/dcl.dcl/bas<wbr>ic.namespace/namespace.udecl/<wbr>p15.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p15.cpp?rev=291955&r1=291954&r2=291955&view=diff" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/CXX/dcl.<wbr>dcl/basic.namespace/namespace.<wbr>udecl/p15.cpp?rev=291955&r1=<wbr>291954&r2=291955&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- cfe/trunk/test/CXX/dcl.dcl/bas<wbr>ic.namespace/namespace.udecl/<wbr>p15.cpp (original)<br>+++ cfe/trunk/test/CXX/dcl.dcl/bas<wbr>ic.namespace/namespace.udecl/<wbr>p15.cpp Fri Jan 13 14:46:54 2017<br>@@ -1,16 +1,16 @@<br> // RUN: %clang_cc1 -std=c++11 -verify %s<br><br>-struct B1 { // expected-note 2{{candidate}}<br>+struct B1 {<br> Â Â B1(int); // expected-note {{candidate}}<br> };<br><br>-struct B2 { // expected-note 2{{candidate}}<br>+struct B2 {<br> Â Â B2(int); // expected-note {{candidate}}<br> };<br><br> struct D1 : B1, B2 { // expected-note 2{{candidate}}<br>- Â using B1::B1; // expected-note 3{{inherited here}}<br>- Â using B2::B2; // expected-note 3{{inherited here}}<br>+ Â using B1::B1; // expected-note {{inherited here}}<br>+ Â using B2::B2; // expected-note {{inherited here}}<br> };<br> D1 d1(0); // expected-error {{ambiguous}}<br><br>@@ -35,7 +35,7 @@ namespace default_ctor {<br> Â Â Â Â operator D&&();<br> Â Â };<br><br>- Â struct A { // expected-note 4{{candidate}}<br>+ Â struct A { // expected-note 2{{candidate}}<br> Â Â Â Â A(); // expected-note {{candidate}}<br><br> Â Â Â Â A(C &&); // expected-note {{candidate}}<br>@@ -47,7 +47,7 @@ namespace default_ctor {<br> Â Â Â Â A(convert_to_D2); // expected-note {{candidate}}<br> Â Â };<br><br>- Â struct B { // expected-note 4{{candidate}}<br>+ Â struct B { // expected-note 2{{candidate}}<br> Â Â Â Â B(); // expected-note {{candidate}}<br><br> Â Â Â Â B(C &&); // expected-note {{candidate}}<br>@@ -66,9 +66,9 @@ namespace default_ctor {<br> Â Â Â Â using B::operator=;<br> Â Â };<br> Â Â struct D : A, B {<br>- Â Â Â using A::A; // expected-note 5{{inherited here}}<br>+ Â Â Â using A::A; // expected-note 3{{inherited here}}<br> Â Â Â Â using A::operator=;<br>- Â Â Â using B::B; // expected-note 5{{inherited here}}<br>+ Â Â Â using B::B; // expected-note 3{{inherited here}}<br> Â Â Â Â using B::operator=;<br><br> Â Â Â Â D(int);<br>@@ -93,13 +93,13 @@ namespace default_ctor {<br> Â Â }<br><br> Â Â struct Y;<br>- Â struct X { // expected-note 2{{candidate}}<br>+ Â struct X {<br> Â Â Â Â X();<br>- Â Â Â X(volatile Y &); // expected-note {{constructor inherited from base class cannot be used to initialize from an argument of the derived class type}}<br>+ Â Â Â X(volatile Y &); // expected-note 3{{inherited constructor cannot be used to copy object}}<br> Â Â } x;<br>- Â struct Y : X { using X::X; } volatile y; // expected-note 2{{candidate}}<br>- Â struct Z : Y { using Y::Y; } volatile z; // expected-note 3{{candidate}} expected-note 5{{inherited here}}<br>- Â Z z1(x); // ok<br>- Â Z z2(y); // ok, Z is not reference-related to type of y<br>+ Â struct Y : X { using X::X; } volatile y;<br>+ Â struct Z : Y { using Y::Y; } volatile z; // expected-note 4{{no known conversion}} expected-note 2{{would lose volatile}} expected-note 3{{requires 0}} expected-note 3{{inherited here}}<br>+ Â Z z1(x); // expected-error {{no match}}<br>+ Â Z z2(y); // expected-error {{no match}}<br> Â Â Z z3(z); // expected-error {{no match}}<br> }<br><br>Modified: cfe/trunk/test/CXX/dcl.decl/dc<wbr>l.init/dcl.init.aggr/p1.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p1.cpp?rev=291955&r1=291954&r2=291955&view=diff" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/CXX/dcl.<wbr>decl/dcl.init/dcl.init.aggr/<wbr>p1.cpp?rev=291955&r1=291954&<wbr>r2=291955&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- cfe/trunk/test/CXX/dcl.decl/dc<wbr>l.init/dcl.init.aggr/p1.cpp (original)<br>+++ cfe/trunk/test/CXX/dcl.decl/dc<wbr>l.init/dcl.init.aggr/p1.cpp Fri Jan 13 14:46:54 2017<br>@@ -134,13 +134,13 @@ ExplicitDefaultedAggr eda2{};<br><br> struct DefaultedBase {<br> Â Â int n;<br>- Â DefaultedBase() = default; // expected-note 0+ {{candidate}}<br>- Â DefaultedBase(DefaultedBase const&) = default; // expected-note 0+ {{candidate}}<br>- Â DefaultedBase(DefaultedBase &&) = default; // expected-note 0+ {{candidate}}<br>+ Â DefaultedBase() = default;<br>+ Â DefaultedBase(DefaultedBase const&) = default;<br>+ Â DefaultedBase(DefaultedBase &&) = default;<br> };<br><br> struct InheritingConstructors : DefaultedBase { // expected-note 3 {{candidate}}<br>- Â using DefaultedBase::DefaultedBase; // expected-note 2 {{inherited here}}<br>+ Â using DefaultedBase::DefaultedBase;<br> };<br> InheritingConstructors ic = { 42 }; // expected-error {{no matching constructor}}<br><br><br>Modified: cfe/trunk/test/CXX/drs/dr16xx.<wbr>cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr16xx.cpp?rev=291955&r1=291954&r2=291955&view=diff" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/CXX/drs/<wbr>dr16xx.cpp?rev=291955&r1=29195<wbr>4&r2=291955&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- cfe/trunk/test/CXX/drs/dr16xx.<wbr>cpp (original)<br>+++ cfe/trunk/test/CXX/drs/dr16xx.<wbr>cpp Fri Jan 13 14:46:54 2017<br>@@ -71,14 +71,14 @@ namespace dr1638 { // dr1638: yes<br><br> namespace dr1645 { // dr1645: 3.9<br> #if __cplusplus >= 201103L<br>- Â struct A { // expected-note 2{{candidate}}<br>+ Â struct A {<br> Â Â Â Â constexpr A(int, float = 0); // expected-note 2{{candidate}}<br> Â Â Â Â explicit A(int, int = 0); // expected-note 2{{candidate}}<br> Â Â Â Â A(int, int, int = 0) = delete; // expected-note {{candidate}}<br> Â Â };<br><br> Â Â struct B : A { // expected-note 2{{candidate}}<br>- Â Â Â using A::A; // expected-note 7{{inherited here}}<br>+ Â Â Â using A::A; // expected-note 5{{inherited here}}<br> Â Â };<br><br> Â Â constexpr B a(0); // expected-error {{ambiguous}}<br><br>Modified: cfe/trunk/test/CXX/drs/dr19xx.<wbr>cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr19xx.cpp?rev=291955&r1=291954&r2=291955&view=diff" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/CXX/drs/<wbr>dr19xx.cpp?rev=291955&r1=29195<wbr>4&r2=291955&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- cfe/trunk/test/CXX/drs/dr19xx.<wbr>cpp (original)<br>+++ cfe/trunk/test/CXX/drs/dr19xx.<wbr>cpp Fri Jan 13 14:46:54 2017<br>@@ -138,18 +138,21 @@ namespace dr1959 { // dr1959: 3.9<br> Â Â struct c;<br> Â Â struct a {<br> Â Â Â Â a() = default;<br>- Â Â Â a(const a &) = delete; // expected-note 2{{deleted}}<br>+ Â Â Â a(const a &) = delete; // expected-note {{deleted}}<br> Â Â Â Â a(const b &) = delete; // not inherited<br>- Â Â Â a(c &&) = delete;<br>- Â Â Â template<typename T> a(T) = delete;<br>+ Â Â Â a(c &&) = delete; // expected-note {{not viable}}<br>+ Â Â Â template<typename T> a(T) = delete; // expected-note {{would take its own class type by value}}<br> Â Â };<br><br>- Â struct b : a { // expected-note {{copy constructor of 'b' is implicitly deleted because base class 'dr1959::a' has a deleted copy constructor}}<br>- Â Â Â using a::a;<br>+ Â struct b : a { // expected-note {{cannot bind}} expected-note {{deleted because}}<br>+ Â Â Â using a::a; // expected-note 2{{inherited here}}<br> Â Â };<br><br> Â Â a x;<br>- Â b y = x; // expected-error {{deleted}}<br>+ Â // FIXME: As a resolution to an open DR against P0136R0, we disallow<br>+ Â // use of inherited constructors to construct from a single argument<br>+ Â // where the base class is reference-related to the argument type.<br>+ Â b y = x; // expected-error {{no viable conversion}}<br> Â Â b z = z; // expected-error {{deleted}}<br><br> Â Â struct c : a {<br>@@ -158,7 +161,7 @@ namespace dr1959 { // dr1959: 3.9<br> Â Â };<br> Â Â // FIXME: As a resolution to an open DR against P0136R0, we disallow<br> Â Â // use of inherited constructors to construct from a single argument<br>- Â // where the derived class is reference-related to its type.<br>+ Â // where the base class is reference-related to the argument type.<br> Â Â c q(static_cast<c&&>(q));<br> #endif<br> }<br><br>Modified: cfe/trunk/test/CXX/special/cla<wbr>ss.inhctor/p1.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/special/class.inhctor/p1.cpp?rev=291955&r1=291954&r2=291955&view=diff" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/CXX/speci<wbr>al/class.inhctor/p1.cpp?rev=<wbr>291955&r1=291954&r2=291955&<wbr>view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- cfe/trunk/test/CXX/special/cla<wbr>ss.inhctor/p1.cpp (original)<br>+++ cfe/trunk/test/CXX/special/cla<wbr>ss.inhctor/p1.cpp Fri Jan 13 14:46:54 2017<br>@@ -3,7 +3,7 @@<br> // Note: [class.inhctor] was removed by P0136R1. This tests the new behavior<br> // for the wording that used to be there.<br><br>-struct A { // expected-note 8{{candidate is the implicit}}<br>+struct A { // expected-note 4{{candidate is the implicit}}<br> Â Â A(...); // expected-note 4{{candidate constructor}} expected-note 4{{candidate inherited constructor}}<br> Â Â A(int = 0, int = 0, int = 0, int = 0, ...); // expected-note 3{{candidate constructor}} expected-note 3{{candidate inherited constructor}}<br> Â Â A(int = 0, int = 0, ...); // expected-note 3{{candidate constructor}} expected-note 3{{candidate inherited constructor}}<br>@@ -15,7 +15,7 @@ struct A { // expected-note 8{{candidate<br> };<br><br> struct B : A { // expected-note 4{{candidate is the implicit}}<br>- Â using A::A; // expected-note 19{{inherited here}}<br>+ Â using A::A; // expected-note 15{{inherited here}}<br> Â Â B(void*);<br> };<br><br><br>Modified: cfe/trunk/test/CXX/special/cla<wbr>ss.inhctor/p3.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/special/class.inhctor/p3.cpp?rev=291955&r1=291954&r2=291955&view=diff" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/CXX/speci<wbr>al/class.inhctor/p3.cpp?rev=<wbr>291955&r1=291954&r2=291955&<wbr>view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- cfe/trunk/test/CXX/special/cla<wbr>ss.inhctor/p3.cpp (original)<br>+++ cfe/trunk/test/CXX/special/cla<wbr>ss.inhctor/p3.cpp Fri Jan 13 14:46:54 2017<br>@@ -14,21 +14,21 @@ D1 d1a(1), d1b(1, 1);<br><br> D1 fd1() { return 1; }<br><br>-struct B2 { // expected-note 2{{candidate}}<br>+struct B2 {<br> Â Â explicit B2(int, int = 0, int = 0);<br> };<br> struct D2 : B2 { // expected-note 2{{candidate constructor}}<br>- Â using B2::B2; // expected-note 2{{inherited here}}<br>+ Â using B2::B2;<br> };<br> D2 d2a(1), d2b(1, 1), d2c(1, 1, 1);<br><br> D2 fd2() { return 1; } // expected-error {{no viable conversion}}<br><br>-struct B3 { // expected-note 2{{candidate}}<br>+struct B3 {<br> Â Â B3(void*); // expected-note {{candidate}}<br> };<br> struct D3 : B3 { // expected-note 2{{candidate constructor}}<br>- Â using B3::B3; // expected-note 3{{inherited here}}<br>+ Â using B3::B3; // expected-note {{inherited here}}<br> };<br> D3 fd3() { return 1; } // expected-error {{no viable conversion}}<br><br><br>Modified: cfe/trunk/test/CXX/special/cla<wbr>ss.inhctor/p7.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/special/class.inhctor/p7.cpp?rev=291955&r1=291954&r2=291955&view=diff" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/CXX/speci<wbr>al/class.inhctor/p7.cpp?rev=<wbr>291955&r1=291954&r2=291955&<wbr>view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- cfe/trunk/test/CXX/special/cla<wbr>ss.inhctor/p7.cpp (original)<br>+++ cfe/trunk/test/CXX/special/cla<wbr>ss.inhctor/p7.cpp Fri Jan 13 14:46:54 2017<br>@@ -3,15 +3,15 @@<br> // Note: [class.inhctor] was removed by P0136R1. This tests the new behavior<br> // for the wording that used to be there.<br><br>-struct B1 { // expected-note 2{{candidate}}<br>+struct B1 {<br> Â Â B1(int); // expected-note {{candidate}}<br> };<br>-struct B2 { // expected-note 2{{candidate}}<br>+struct B2 {<br> Â Â B2(int); // expected-note {{candidate}}<br> };<br> struct D1 : B1, B2 { // expected-note 2{{candidate}}<br>- Â using B1::B1; // expected-note 3{{inherited here}}<br>- Â using B2::B2; // expected-note 3{{inherited here}}<br>+ Â using B1::B1; // expected-note {{inherited here}}<br>+ Â using B2::B2; // expected-note {{inherited here}}<br> };<br> struct D2 : B1, B2 {<br> Â Â using B1::B1;<br><br>Modified: cfe/trunk/test/SemaCXX/cxx11-i<wbr>nheriting-ctors.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx11-inheriting-ctors.cpp?rev=291955&r1=291954&r2=291955&view=diff" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/SemaCXX/<wbr>cxx11-inheriting-ctors.cpp?<wbr>rev=291955&r1=291954&r2=<wbr>291955&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- cfe/trunk/test/SemaCXX/cxx11-i<wbr>nheriting-ctors.cpp (original)<br>+++ cfe/trunk/test/SemaCXX/cxx11-i<wbr>nheriting-ctors.cpp Fri Jan 13 14:46:54 2017<br>@@ -56,9 +56,9 @@ namespace InvalidConstruction {<br> }<br><br> namespace ExplicitConv {<br>- Â struct B {}; // expected-note 2{{candidate}}<br>+ Â struct B {};<br> Â Â struct D : B { // expected-note 3{{candidate}}<br>- Â Â Â using B::B; // expected-note 2{{inherited}}<br>+ Â Â Â using B::B;<br> Â Â };<br> Â Â struct X { explicit operator B(); } x;<br> Â Â struct Y { explicit operator D(); } y;<br>@@ -68,19 +68,40 @@ namespace ExplicitConv {<br> }<br><br> namespace NestedListInit {<br>- Â struct B { B(); } b; // expected-note 5{{candidate}}<br>- Â struct D : B { // expected-note 3{{candidate}}<br>- Â Â Â using B::B; // expected-note 2{{inherited}}<br>+ Â struct B { B(); } b; // expected-note 3{{candidate}}<br>+ Â struct D : B { // expected-note 14{{not viable}}<br>+ Â Â Â using B::B;<br> Â Â };<br> Â Â // This is a bit weird. We're allowed one pair of braces for overload<br> Â Â // resolution, and one more pair of braces due to [over.ics.list]/2.<br> Â Â B b1 = {b};<br> Â Â B b2 = {{b}};<br> Â Â B b3 = {{{b}}}; // expected-error {{no match}}<br>- Â // This is the same, but we get one call to D's version of B::B(const B&)<br>- Â // before the two permitted calls to D::D(D&&).<br>- Â D d1 = {b};<br>- Â D d2 = {{b}};<br>- Â D d3 = {{{b}}};<br>+ Â // Per a proposed defect resolution, we don't get to call<br>+ Â // D's version of B::B(const B&) here.<br>+ Â D d0 = b; // expected-error {{no viable conversion}}<br>+ Â D d1 = {b}; // expected-error {{no match}}<br>+ Â D d2 = {{b}}; // expected-error {{no match}}<br>+ Â D d3 = {{{b}}}; // expected-error {{no match}}<br> Â Â D d4 = {{{{b}}}}; // expected-error {{no match}}<br> }<br>+<br>+namespace PR31606 {<br>+ Â // PR31606: as part of a proposed defect resolution, do not consider<br>+ Â // inherited constructors that would be copy constructors for any class<br>+ Â // between the declaring class and the constructed class (inclusive).<br>+ Â struct Base {};<br>+<br>+ Â struct A : Base {<br>+ Â Â Â using Base::Base;<br>+ Â Â Â bool operator==(A const &) const; // expected-note {{no known conversion from 'PR31606::B' to 'const PR31606::A' for 1st argument}}<br>+ Â };<br>+<br>+ Â struct B : Base {<br>+ Â Â Â using Base::Base;<br>+ Â };<br>+<br>+ Â bool a = A{} == A{};<br>+ Â // Note, we do *not* allow operator=='s argument to use the inherited A::A(Base&&) constructor to construct from B{}.<br>+ Â bool b = A{} == B{}; // expected-error {{invalid operands}}<br>+}<br><br>Modified: cfe/trunk/test/SemaTemplate/cx<wbr>x1z-using-declaration.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/cxx1z-using-declaration.cpp?rev=291955&r1=291954&r2=291955&view=diff" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/SemaTempl<wbr>ate/cxx1z-using-declaration.<wbr>cpp?rev=291955&r1=291954&r2=<wbr>291955&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- cfe/trunk/test/SemaTemplate/cx<wbr>x1z-using-declaration.cpp (original)<br>+++ cfe/trunk/test/SemaTemplate/cx<wbr>x1z-using-declaration.cpp Fri Jan 13 14:46:54 2017<br>@@ -17,7 +17,7 @@ void test_Unexpanded() {<br><br> // Test using non-type members from pack of base classes.<br> template<typename ...T> struct A : T... { // expected-note 2{{candidate}}<br>- Â using T::T ...; // expected-note 6{{inherited here}}<br>+ Â using T::T ...; // expected-note 2{{inherited here}}<br> Â Â using T::operator() ...;<br> Â Â using T::operator T* ...;<br> Â Â using T::h ...;<br>@@ -29,7 +29,7 @@ template<typename ...T> struct A : T...<br> };<br><br> namespace test_A {<br>- Â struct X { // expected-note 2{{candidate}}<br>+ Â struct X {<br> Â Â Â Â X();<br> Â Â Â Â X(int); // expected-note {{candidate}}<br> Â Â Â Â void operator()(int); // expected-note 2{{candidate}}<br>@@ -43,7 +43,7 @@ namespace test_A {<br> Â Â Â Â operator Y *();<br> Â Â Â Â void h(int, int); // expected-note {{not viable}}<br> Â Â };<br>- Â struct Z { // expected-note 2{{candidate}}<br>+ Â struct Z {<br> Â Â Â Â Z();<br> Â Â Â Â Z(int); // expected-note {{candidate}}<br> Â Â Â Â void operator()(int); // expected-note 2{{candidate}}<br><br><br>______________________________<wbr>_________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br></div></div></blockquote></div><br></div></div></div></div></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div></div>