]> granicus.if.org Git - clang/commitdiff
Add tests for newly-resolved core issues <= 370.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 4 Mar 2014 21:14:30 +0000 (21:14 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 4 Mar 2014 21:14:30 +0000 (21:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202889 91177308-0d34-0410-b5e6-96231b3b80d8

test/CXX/drs/dr0xx.cpp
test/CXX/drs/dr1xx.cpp
test/CXX/drs/dr2xx.cpp
test/CXX/drs/dr3xx.cpp
www/cxx_dr_status.html

index f11bb9d68736e0e56bbfa0f8dadb5949f8b48420..001549164b9b1875ee56f5b017b770ef8427a799 100644 (file)
@@ -141,6 +141,21 @@ namespace dr12 { // dr12: sup 239
   }
 }
 
+namespace dr13 { // dr13: no
+  extern "C" void f(int);
+  void g(char);
+
+  template<typename T> struct A {
+    A(void (*fp)(T));
+  };
+  template<typename T> int h(void (T));
+
+  A<int> a1(f); // FIXME: We should reject this.
+  A<char> 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<void() throw()> struct X {};
+  X<&f> xp; // ok
+}
+
 // dr93: na
 
 namespace dr94 { // dr94: yes
index 576f64ee9c311d403a184c6a56cac03fab45272a..6a18b53fe05d9d66e3da59bf4fbf37de2a7a47aa 100644 (file)
@@ -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();
index cf0d33dfae9e397a808f84a7de7bf788186ffe5b..19cb122aa6fc3772ddb1a1d1492b06910c520945 100644 (file)
@@ -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<int>() {}
 }
 
+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 {
index 35fd8a4d3750f38109f9112189dcc3196f4980af..2784ca61efe22d1143c6c574fcdaea4b92649307 100644 (file)
@@ -180,6 +180,15 @@ namespace dr313 { // dr313: dup 299 c++11
 #endif
 }
 
+namespace dr314 { // dr314: dup 1710
+  template<typename T> struct A {
+    template<typename U> struct B {};
+  };
+  template<typename T> struct C : public A<T>::template B<T> {
+    C() : A<T>::template B<T>() {}
+  };
+}
+
 // dr315: na
 // dr316: sup 1004
 
@@ -469,6 +478,22 @@ namespace dr341 {
 
 // dr342: na
 
+namespace dr343 { // dr343: no
+  // FIXME: dup 1710
+  template<typename T> struct A {
+    template<typename U> struct B {};
+  };
+  // FIXME: In these contexts, the 'template' keyword is optional.
+  template<typename T> struct C : public A<T>::B<T> { // expected-error {{use 'template'}}
+    C() : A<T>::B<T>() {} // 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 {};
index 926e866b3639603dc538ad1d3ba212b518a0f1bb..ebd2869a69bec1cb19d62174bd8260e88d4f3320 100644 (file)
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#13">13</a></td>
     <td>NAD</td>
     <td>extern "C" for Parameters of Function Templates</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="none" align="center">No</td>
   </tr>
   <tr>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#14">14</a></td>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#92">92</a></td>
     <td>NAD</td>
     <td>Should <I>exception-specification</I>s be part of the type system?</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#93">93</a></td>
@@ -1372,7 +1372,7 @@ accessible?</td>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#222">222</a></td>
     <td>CD1</td>
     <td>Sequence points and lvalue-returning operators</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="none" align="center">Duplicate of 637</td>
   </tr>
   <tr>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#223">223</a></td>
@@ -1420,7 +1420,7 @@ accessible?</td>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#230">230</a></td>
     <td>NAD</td>
     <td>Calls to pure virtual functions</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#231">231</a></td>
@@ -1925,7 +1925,7 @@ of class templates</td>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#314">314</a></td>
     <td>ready</td>
     <td><TT>template</TT> in base class specifier</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="none" align="center">Duplicate of 1710</td>
   </tr>
   <tr>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#315">315</a></td>
@@ -2099,13 +2099,13 @@ of class templates</td>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#343">343</a></td>
     <td>ready</td>
     <td>Make <TT>template</TT> optional in contexts that require a type</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="none" align="center">No</td>
   </tr>
   <tr>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#344">344</a></td>
     <td>CD3</td>
     <td>Naming destructors</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="none" align="center">Duplicate of 1435</td>
   </tr>
   <tr>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#345">345</a></td>