<p dir="ltr">On 11 Sep 2014 11:05, "Ismail Pazarbasi" <<a href="mailto:ismail.pazarbasi@gmail.com">ismail.pazarbasi@gmail.com</a>> wrote:<br>
><br>
> Richard,<br>
><br>
> I thought we were supporting DR580 since last year.</p>
<p dir="ltr">We more or less are, but the test uncovered a bug. See the FIXME.</p>
<p dir="ltr">> r180707 - Implement DR580: access checks for template parameters of a<br>
> class template<br>
><br>
> On Thu, Sep 11, 2014 at 7:28 PM, Richard Smith<br>
> <<a href="mailto:richard-llvm@metafoo.co.uk">richard-llvm@metafoo.co.uk</a>> wrote:<br>
> > Author: rsmith<br>
> > Date: Thu Sep 11 12:28:14 2014<br>
> > New Revision: 217606<br>
> ><br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=217606&view=rev">http://llvm.org/viewvc/llvm-project?rev=217606&view=rev</a><br>
> > Log:<br>
> > Tests for DR573-580.<br>
> ><br>
> > Modified:<br>
> >     cfe/trunk/test/CXX/drs/dr5xx.cpp<br>
> >     cfe/trunk/www/cxx_dr_status.html<br>
> ><br>
> > Modified: cfe/trunk/test/CXX/drs/dr5xx.cpp<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr5xx.cpp?rev=217606&r1=217605&r2=217606&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr5xx.cpp?rev=217606&r1=217605&r2=217606&view=diff</a><br>
> > ==============================================================================<br>
> > --- cfe/trunk/test/CXX/drs/dr5xx.cpp (original)<br>
> > +++ cfe/trunk/test/CXX/drs/dr5xx.cpp Thu Sep 11 12:28:14 2014<br>
> > @@ -726,3 +726,129 @@ namespace dr572 { // dr572: yes<br>
> >    enum E { a = 1, b = 2 };<br>
> >    int check[a + b == 3 ? 1 : -1];<br>
> >  }<br>
> > +<br>
> > +namespace dr573 { // dr573: no<br>
> > +  void *a;<br>
> > +  int *b = reinterpret_cast<int*>(a);<br>
> > +  void (*c)() = reinterpret_cast<void(*)()>(a);<br>
> > +  void *d = reinterpret_cast<void*>(c);<br>
> > +#if __cplusplus < 201103L<br>
> > +  // expected-error@-3 {{extension}}<br>
> > +  // expected-error@-3 {{extension}}<br>
> > +#endif<br>
> > +  void f() { delete a; } // expected-error {{cannot delete}}<br>
> > +  int n = d - a; // expected-error {{arithmetic on pointers to void}}<br>
> > +  // FIXME: This is ill-formed.<br>
> > +  template<void*> struct S;<br>
> > +  template<int*> struct T;<br>
> > +}<br>
> > +<br>
> > +namespace dr574 { // dr574: yes<br>
> > +  struct A {<br>
> > +    A &operator=(const A&) const; // expected-note {{does not match because it is const}}<br>
> > +  };<br>
> > +  struct B {<br>
> > +    B &operator=(const B&) volatile; // expected-note {{nearly matches}}<br>
> > +  };<br>
> > +#if __cplusplus >= 201103L<br>
> > +  struct C {<br>
> > +    C &operator=(const C&) &; // expected-note {{not viable}} expected-note {{nearly matches}} expected-note {{here}}<br>
> > +  };<br>
> > +  struct D {<br>
> > +    D &operator=(const D&) &&; // expected-note {{not viable}} expected-note {{nearly matches}} expected-note {{here}}<br>
> > +  };<br>
> > +  void test(C c, D d) {<br>
> > +    c = c;<br>
> > +    C() = c; // expected-error {{no viable}}<br>
> > +    d = d; // expected-error {{no viable}}<br>
> > +    D() = d;<br>
> > +  }<br>
> > +#endif<br>
> > +  struct Test {<br>
> > +    friend A &A::operator=(const A&); // expected-error {{does not match}}<br>
> > +    friend B &B::operator=(const B&); // expected-error {{does not match}}<br>
> > +#if __cplusplus >= 201103L<br>
> > +    // FIXME: We shouldn't produce the 'cannot overload' diagnostics here.<br>
> > +    friend C &C::operator=(const C&); // expected-error {{does not match}} expected-error {{cannot overload}}<br>
> > +    friend D &D::operator=(const D&); // expected-error {{does not match}} expected-error {{cannot overload}}<br>
> > +#endif<br>
> > +  };<br>
> > +}<br>
> > +<br>
> > +namespace dr575 { // dr575: yes<br>
> > +  template<typename T, typename U = typename T::type> void a(T); void a(...); // expected-error 0-1{{extension}}<br>
> > +  template<typename T, typename T::type U = 0> void b(T); void b(...); // expected-error 0-1{{extension}}<br>
> > +  template<typename T, int U = T::value> void c(T); void c(...); // expected-error 0-1{{extension}}<br>
> > +  template<typename T> void d(T, int = T::value); void d(...); // expected-error {{cannot be used prior to '::'}}<br>
> > +  void x() {<br>
> > +    a(0);<br>
> > +    b(0);<br>
> > +    c(0);<br>
> > +    d(0); // expected-note {{in instantiation of default function argument}}<br>
> > +  }<br>
> > +<br>
> > +  template<typename T = int&> void f(T* = 0); // expected-error 0-1{{extension}}<br>
> > +  template<typename T = int> void f(T = 0); // expected-error 0-1{{extension}}<br>
> > +  void g() { f<>(); }<br>
> > +<br>
> > +  template<typename T> T &h(T *);<br>
> > +  template<typename T> T *h(T *);<br>
> > +  void *p = h((void*)0);<br>
> > +}<br>
> > +<br>
> > +namespace dr576 { // dr576: yes<br>
> > +  typedef void f() {} // expected-error {{function definition is not allowed}}<br>
> > +  void f(typedef int n); // expected-error {{invalid storage class}}<br>
> > +  void f(char c) { typedef int n; }<br>
> > +}<br>
> > +<br>
> > +namespace dr577 { // dr577: yes<br>
> > +  typedef void V;<br>
> > +  typedef const void CV;<br>
> > +  void a(void);<br>
> > +  void b(const void); // expected-error {{qualifiers}}<br>
> > +  void c(V);<br>
> > +  void d(CV); // expected-error {{qualifiers}}<br>
> > +  void (*e)(void) = c;<br>
> > +  void (*f)(const void); // expected-error {{qualifiers}}<br>
> > +  void (*g)(V) = a;<br>
> > +  void (*h)(CV); // expected-error {{qualifiers}}<br>
> > +  template<typename T> void i(T); // expected-note 2{{requires 1 arg}}<br>
> > +  template<typename T> void j(void (*)(T)); // expected-note 2{{argument may not have 'void' type}}<br>
> > +  void k() {<br>
> > +    a();<br>
> > +    c();<br>
> > +    i<void>(); // expected-error {{no match}}<br>
> > +    i<const void>(); // expected-error {{no match}}<br>
> > +    j<void>(0); // expected-error {{no match}}<br>
> > +    j<const void>(0); // expected-error {{no match}}<br>
> > +  }<br>
> > +}<br>
> > +<br>
> > +namespace dr580 { // dr580: no<br>
> > +  class C;<br>
> > +  struct A { static C c; };<br>
> > +  struct B { static C c; };<br>
> > +  class C {<br>
> > +    C(); // expected-note {{here}}<br>
> > +    ~C(); // expected-note {{here}}<br>
> > +<br>
> > +    typedef int I; // expected-note {{here}}<br>
> > +    template<int> struct X;<br>
> > +    template<int> friend struct Y;<br>
> > +    template<int> void f();<br>
> > +    template<int> friend void g();<br>
> > +    friend struct A;<br>
> > +  };<br>
> > +<br>
> > +  template<C::I> struct C::X {};<br>
> > +  template<C::I> struct Y {};<br>
> > +  template<C::I> struct Z {}; // FIXME: should reject, accepted because C befriends A!<br>
> > +<br>
> > +  template<C::I> void C::f() {}<br>
> > +  template<C::I> void g() {}<br>
> > +  template<C::I> void h() {} // expected-error {{private}}<br>
> > +<br>
> > +  C A::c;<br>
> > +  C B::c; // expected-error 2{{private}}<br>
> > +}<br>
> ><br>
> > Modified: cfe/trunk/www/cxx_dr_status.html<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_dr_status.html?rev=217606&r1=217605&r2=217606&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_dr_status.html?rev=217606&r1=217605&r2=217606&view=diff</a><br>
> > ==============================================================================<br>
> > --- cfe/trunk/www/cxx_dr_status.html (original)<br>
> > +++ cfe/trunk/www/cxx_dr_status.html Thu Sep 11 12:28:14 2014<br>
> > @@ -147,7 +147,7 @@<br>
> >      <td><a href="<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#18">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#18</a>">18</a></td><br>
> >      <td>NAD</td><br>
> >      <td>f(TYPE) where TYPE is void should be allowed</td><br>
> > -    <td class="none" align="center">Superseded by <a href="#577">577</a></td><br>
> > +    <td class="full" align="center">Superseded by <a href="#577">577</a></td><br>
> >    </tr><br>
> >    <tr id="19"><br>
> >      <td><a href="<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#19">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#19</a>">19</a></td><br>
> > @@ -2033,7 +2033,7 @@ of class templates</td><br>
> >      <td><a href="<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#332">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#332</a>">332</a></td><br>
> >      <td>CD3</td><br>
> >      <td>cv-qualified <TT>void</TT> parameter types</td><br>
> > -    <td class="none" align="center">Duplicate of <a href="#577">577</a></td><br>
> > +    <td class="full" align="center">Duplicate of <a href="#577">577</a></td><br>
> >    </tr><br>
> >    <tr id="333"><br>
> >      <td><a href="<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#333">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#333</a>">333</a></td><br>
> > @@ -3481,31 +3481,31 @@ and <I>POD class</I></td><br>
> >      <td><a href="<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#573">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#573</a>">573</a></td><br>
> >      <td>C++11</td><br>
> >      <td>Conversions between function pointers and <TT>void*</TT></td><br>
> > -    <td class="none" align="center">Unknown</td><br>
> > +    <td class="none" align="center">No</td><br>
> >    </tr><br>
> >    <tr id="574"><br>
> >      <td><a href="<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#574">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#574</a>">574</a></td><br>
> >      <td>NAD</td><br>
> >      <td>Definition of &#8220;copy assignment operator&#8221;</td><br>
> > -    <td class="none" align="center">Unknown</td><br>
> > +    <td class="full" align="center">Yes</td><br>
> >    </tr><br>
> >    <tr id="575"><br>
> >      <td><a href="<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#575">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#575</a>">575</a></td><br>
> >      <td>C++11</td><br>
> >      <td>Criteria for deduction failure</td><br>
> > -    <td class="none" align="center">Unknown</td><br>
> > +    <td class="full" align="center">Yes</td><br>
> >    </tr><br>
> >    <tr id="576"><br>
> >      <td><a href="<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#576">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#576</a>">576</a></td><br>
> >      <td>CD2</td><br>
> >      <td>Typedefs in function definitions</td><br>
> > -    <td class="none" align="center">Unknown</td><br>
> > +    <td class="full" align="center">Yes</td><br>
> >    </tr><br>
> >    <tr id="577"><br>
> >      <td><a href="<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#577">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#577</a>">577</a></td><br>
> >      <td>CD3</td><br>
> >      <td><TT>void</TT> in an empty parameter list</td><br>
> > -    <td class="none" align="center">Unknown</td><br>
> > +    <td class="full" align="center">Yes</td><br>
> >    </tr><br>
> >    <tr class="open" id="578"><br>
> >      <td><a href="<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#578">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#578</a>">578</a></td><br>
> > @@ -3523,7 +3523,7 @@ and <I>POD class</I></td><br>
> >      <td><a href="<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#580">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#580</a>">580</a></td><br>
> >      <td>C++11</td><br>
> >      <td>Access in <I>template-parameter</I>s of member and friend definitions</td><br>
> > -    <td class="none" align="center">Unknown</td><br>
> > +    <td class="none" align="center">No</td><br>
> >    </tr><br>
> >    <tr class="open" id="581"><br>
> >      <td><a href="<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#581">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#581</a>">581</a></td><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > cfe-commits mailing list<br>
> > <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</p>