From: Richard Smith Date: Tue, 4 Mar 2014 21:14:30 +0000 (+0000) Subject: Add tests for newly-resolved core issues <= 370. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da44725a134d61c22e8eb29bd409c73496fd524e;p=clang Add tests for newly-resolved core issues <= 370. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202889 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CXX/drs/dr0xx.cpp b/test/CXX/drs/dr0xx.cpp index f11bb9d687..001549164b 100644 --- a/test/CXX/drs/dr0xx.cpp +++ b/test/CXX/drs/dr0xx.cpp @@ -141,6 +141,21 @@ namespace dr12 { // dr12: sup 239 } } +namespace dr13 { // dr13: no + extern "C" void f(int); + void g(char); + + template struct A { + A(void (*fp)(T)); + }; + template int h(void (T)); + + A a1(f); // FIXME: We should reject this. + A a2(g); + int a3 = h(f); // FIXME: We should reject this. + int a4 = h(g); +} + namespace dr14 { // dr14: yes namespace X { extern "C" int dr14_f(); } namespace Y { extern "C" int dr14_f(); } @@ -951,6 +966,22 @@ namespace dr91 { // dr91: yes int k = f(U()); } +namespace dr92 { // dr92: yes + void f() throw(int, float); + void (*p)() throw(int) = &f; // expected-error {{target exception specification is not superset of source}} + void (*q)() throw(int); + void (**pp)() throw() = &q; // expected-error {{exception specifications are not allowed}} + + void g(void() throw()); + void h() { + g(f); // expected-error {{is not superset}} + g(q); // expected-error {{is not superset}} + } + + template struct X {}; + X<&f> xp; // ok +} + // dr93: na namespace dr94 { // dr94: yes diff --git a/test/CXX/drs/dr1xx.cpp b/test/CXX/drs/dr1xx.cpp index 576f64ee9c..6a18b53fe0 100644 --- a/test/CXX/drs/dr1xx.cpp +++ b/test/CXX/drs/dr1xx.cpp @@ -594,6 +594,8 @@ namespace dr155 { // dr155: dup 632 struct S { int n; } s = { { 1 } }; // expected-warning {{braces around scalar initializer}} } +// dr158 FIXME write codegen test + namespace dr159 { // dr159: 3.5 namespace X { void f(); } void f(); diff --git a/test/CXX/drs/dr2xx.cpp b/test/CXX/drs/dr2xx.cpp index cf0d33dfae..19cb122aa6 100644 --- a/test/CXX/drs/dr2xx.cpp +++ b/test/CXX/drs/dr2xx.cpp @@ -216,8 +216,22 @@ namespace dr221 { // dr221: yes } } -// dr222 is a mystery -- it lists no changes to the standard, and yet was -// apparently both voted into the WP and acted upon by the editor. +namespace dr222 { // dr222: dup 637 + void f(int a, int b, int c, int *x) { +#pragma clang diagnostic push +#pragma clang diagnostic warning "-Wunsequenced" + void((a += b) += c); + void((a += b) + (a += c)); // expected-warning {{multiple unsequenced modifications to 'a'}} + + x[a++] = a; // expected-warning {{unsequenced modification and access to 'a'}} + + a = b = 0; // ok, read and write of 'b' are sequenced + + a = (b = a++); // expected-warning {{multiple unsequenced modifications to 'a'}} + a = (b = ++a); +#pragma clang diagnostic pop + } +} // dr223: na @@ -363,6 +377,13 @@ namespace dr229 { // dr229: yes template<> void f() {} } +namespace dr230 { // dr230: yes + struct S { + S() { f(); } // expected-warning {{call to pure virtual member function}} + virtual void f() = 0; // expected-note {{declared here}} + }; +} + namespace dr231 { // dr231: yes namespace outer { namespace inner { diff --git a/test/CXX/drs/dr3xx.cpp b/test/CXX/drs/dr3xx.cpp index 35fd8a4d37..2784ca61ef 100644 --- a/test/CXX/drs/dr3xx.cpp +++ b/test/CXX/drs/dr3xx.cpp @@ -180,6 +180,15 @@ namespace dr313 { // dr313: dup 299 c++11 #endif } +namespace dr314 { // dr314: dup 1710 + template struct A { + template struct B {}; + }; + template struct C : public A::template B { + C() : A::template B() {} + }; +} + // dr315: na // dr316: sup 1004 @@ -469,6 +478,22 @@ namespace dr341 { // dr342: na +namespace dr343 { // dr343: no + // FIXME: dup 1710 + template struct A { + template struct B {}; + }; + // FIXME: In these contexts, the 'template' keyword is optional. + template struct C : public A::B { // expected-error {{use 'template'}} + C() : A::B() {} // expected-error {{use 'template'}} + }; +} + +namespace dr344 { // dr344: dup 1435 + struct A { inline virtual ~A(); }; + struct B { friend A::~A(); }; +} + namespace dr345 { // dr345: yes struct A { struct X {}; diff --git a/www/cxx_dr_status.html b/www/cxx_dr_status.html index 926e866b36..ebd2869a69 100644 --- a/www/cxx_dr_status.html +++ b/www/cxx_dr_status.html @@ -117,7 +117,7 @@ 13 NAD extern "C" for Parameters of Function Templates - Unknown + No 14 @@ -591,7 +591,7 @@ 92 NAD Should exception-specifications be part of the type system? - Unknown + Yes 93 @@ -1372,7 +1372,7 @@ accessible? 222 CD1 Sequence points and lvalue-returning operators - Unknown + Duplicate of 637 223 @@ -1420,7 +1420,7 @@ accessible? 230 NAD Calls to pure virtual functions - Unknown + Yes 231 @@ -1925,7 +1925,7 @@ of class templates 314 ready template in base class specifier - Unknown + Duplicate of 1710 315 @@ -2099,13 +2099,13 @@ of class templates 343 ready Make template optional in contexts that require a type - Unknown + No 344 CD3 Naming destructors - Unknown + Duplicate of 1435 345