<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="">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=""> 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=""> 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=""> 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=""> 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=""> 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=""> 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=""> 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><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 class=""><br class=""></div><div class="">The patch I have now just checks whether PointOfInstantiation.isValid() returns true before calling Spec->setPointOfInstantiation at SemaTemplateInstantiate.cpp:1938.</div><div class=""><br class=""><div><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" class="">cfe-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-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: <a href="http://llvm.org/viewvc/llvm-project?rev=291955&view=rev" class="">http://llvm.org/viewvc/llvm-project?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/Basic/DiagnosticSemaKinds.td<br class=""> cfe/trunk/lib/Sema/SemaOverload.cpp<br class=""> cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p15.cpp<br class=""> cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p1.cpp<br class=""> cfe/trunk/test/CXX/drs/dr16xx.cpp<br class=""> cfe/trunk/test/CXX/drs/dr19xx.cpp<br class=""> cfe/trunk/test/CXX/special/class.inhctor/p1.cpp<br class=""> cfe/trunk/test/CXX/special/class.inhctor/p3.cpp<br class=""> cfe/trunk/test/CXX/special/class.inhctor/p7.cpp<br class=""> cfe/trunk/test/SemaCXX/cxx11-inheriting-ctors.cpp<br class=""> cfe/trunk/test/SemaTemplate/cxx1z-using-declaration.cpp<br class=""><br class="">Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=291955&r1=291954&r2=291955&view=diff" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=291955&r1=291954&r2=291955&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)<br class="">+++ cfe/trunk/include/clang/Basic/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_constructor : Note<<br class=""> "constructor from base class %0 inherited here">;<br class=""> def note_ovl_candidate_inherited_constructor_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_constructor : 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/SemaOverload.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=291955&r1=291954&r2=291955&view=diff" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=291955&r1=291954&r2=291955&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)<br class="">+++ cfe/trunk/lib/Sema/SemaOverload.cpp Fri Jan 13 14:46:54 2017<br class="">@@ -5944,6 +5944,28 @@ Sema::AddOverloadCandidate(FunctionDecl<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<ConstructorUsingShadowDecl>(FoundDecl.getDecl());<br class="">+ if (Shadow && Args.size() == 1 && Constructor->getNumParams() >= 1 &&<br class="">+ Constructor->getParamDecl(0)->getType()->isReferenceType()) {<br class="">+ QualType P = Constructor->getParamDecl(0)->getType()->getPointeeType();<br class="">+ QualType C = Context.getRecordType(Constructor->getParent());<br class="">+ QualType D = Context.getRecordType(Shadow->getParent());<br class="">+ SourceLocation Loc = Args.front()->getExprLoc();<br class="">+ if ((Context.hasSameUnqualifiedType(P, C) || IsDerivedFrom(Loc, P, C)) &&<br class="">+ (Context.hasSameUnqualifiedType(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(FunctionDecl<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. <br class="">- auto *Shadow = dyn_cast<ConstructorUsingShadowDecl>(FoundDecl.getDecl());<br class="">- if (Shadow && Args.size() == 1 && !isa<InitListExpr>(Args.front())) {<br class="">- bool DerivedToBase, ObjCConversion, ObjCLifetimeConversion;<br class="">- QualType ConvertedArgumentType = Args.front()->getType();<br class="">- if (Candidate.Conversions[0].isUserDefined())<br class="">- ConvertedArgumentType =<br class="">- Candidate.Conversions[0].UserDefined.After.getFromType();<br class="">- if (CompareReferenceRelationship(Args.front()->getLocStart(),<br class="">- Context.getRecordType(Shadow->getParent()),<br class="">- ConvertedArgumentType, DerivedToBase,<br class="">- ObjCConversion,<br 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 DiagnoseOpenCLExtensionDisabled(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)->isCopyOrMoveConstructor())<br class="">+ return;<br class=""> S.Diag(Fn->getLocation(),<br class="">- diag::note_ovl_candidate_inherited_constructor_slice);<br class="">+ diag::note_ovl_candidate_inherited_constructor_slice)<br class="">+ << (Fn->getPrimaryTemplate() ? 1 : 0)<br class="">+ << Fn->getParamDecl(0)->getType()->isRValueReferenceType();<br class=""> MaybeEmitInheritedConstructorNote(S, Cand->FoundDecl);<br class=""> return;<br class=""><br class=""><br class="">Modified: cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p15.cpp<br class="">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" class="">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</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p15.cpp (original)<br class="">+++ cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/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/dcl.init/dcl.init.aggr/p1.cpp<br class="">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" class="">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</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p1.cpp (original)<br class="">+++ cfe/trunk/test/CXX/dcl.decl/dcl.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.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr16xx.cpp?rev=291955&r1=291954&r2=291955&view=diff" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr16xx.cpp?rev=291955&r1=291954&r2=291955&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/CXX/drs/dr16xx.cpp (original)<br class="">+++ cfe/trunk/test/CXX/drs/dr16xx.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.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr19xx.cpp?rev=291955&r1=291954&r2=291955&view=diff" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr19xx.cpp?rev=291955&r1=291954&r2=291955&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/CXX/drs/dr19xx.cpp (original)<br class="">+++ cfe/trunk/test/CXX/drs/dr19xx.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/class.inhctor/p1.cpp<br class="">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" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/special/class.inhctor/p1.cpp?rev=291955&r1=291954&r2=291955&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/CXX/special/class.inhctor/p1.cpp (original)<br class="">+++ cfe/trunk/test/CXX/special/class.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/class.inhctor/p3.cpp<br class="">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" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/special/class.inhctor/p3.cpp?rev=291955&r1=291954&r2=291955&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/CXX/special/class.inhctor/p3.cpp (original)<br class="">+++ cfe/trunk/test/CXX/special/class.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/class.inhctor/p7.cpp<br class="">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" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/special/class.inhctor/p7.cpp?rev=291955&r1=291954&r2=291955&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/CXX/special/class.inhctor/p7.cpp (original)<br class="">+++ cfe/trunk/test/CXX/special/class.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-inheriting-ctors.cpp<br class="">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" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx11-inheriting-ctors.cpp?rev=291955&r1=291954&r2=291955&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/SemaCXX/cxx11-inheriting-ctors.cpp (original)<br class="">+++ cfe/trunk/test/SemaCXX/cxx11-inheriting-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/cxx1z-using-declaration.cpp<br class="">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" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/cxx1z-using-declaration.cpp?rev=291955&r1=291954&r2=291955&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/SemaTemplate/cxx1z-using-declaration.cpp (original)<br class="">+++ cfe/trunk/test/SemaTemplate/cxx1z-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="">_______________________________________________<br class="">cfe-commits mailing list<br class=""><a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits<br class=""></div></div></blockquote></div><br class=""></div></body></html>