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