r203549 - Tests for DR381-388.

Richard Smith richard-llvm at metafoo.co.uk
Tue Mar 11 00:49:33 PDT 2014


Author: rsmith
Date: Tue Mar 11 02:49:32 2014
New Revision: 203549

URL: http://llvm.org/viewvc/llvm-project?rev=203549&view=rev
Log:
Tests for DR381-388.

Modified:
    cfe/trunk/test/CXX/drs/dr3xx.cpp
    cfe/trunk/www/cxx_dr_status.html

Modified: cfe/trunk/test/CXX/drs/dr3xx.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr3xx.cpp?rev=203549&r1=203548&r2=203549&view=diff
==============================================================================
--- cfe/trunk/test/CXX/drs/dr3xx.cpp (original)
+++ cfe/trunk/test/CXX/drs/dr3xx.cpp Tue Mar 11 02:49:32 2014
@@ -924,3 +924,105 @@ namespace dr377 { // dr377: yes
 
 // dr378: dup 276
 // dr379: na
+
+namespace dr381 { // dr381: yes
+  struct A {
+    int a;
+  };
+  struct B : virtual A {};
+  struct C : B {};
+  struct D : B {};
+  struct E : public C, public D {};
+  struct F : public A {};
+  void f() {
+    E e;
+    e.B::a = 0; // expected-error {{ambiguous conversion}}
+    F f;
+    f.A::a = 1;
+  }
+}
+
+namespace dr382 { // dr382: yes c++11
+  // FIXME: Should we allow this in C++98 mode?
+  struct A { typedef int T; };
+  typename A::T t;
+  typename dr382::A a;
+#if __cplusplus < 201103L
+  // expected-error at -3 {{occurs outside of a template}}
+  // expected-error at -3 {{occurs outside of a template}}
+#endif
+  typename A b; // expected-error {{expected a qualified name}}
+}
+
+namespace dr383 { // dr383: yes
+  struct A { A &operator=(const A&); };
+  struct B { ~B(); };
+  union C { C &operator=(const C&); };
+  union D { ~D(); };
+  int check[(__is_pod(A) || __is_pod(B) || __is_pod(C) || __is_pod(D)) ? -1 : 1];
+}
+
+namespace dr384 { // dr384: yes
+  namespace N1 {
+    template<typename T> struct Base {};
+    template<typename T> struct X {
+      struct Y : public Base<T> {
+        Y operator+(int) const;
+      };
+      Y f(unsigned i) { return Y() + i; }
+    };
+  }
+
+  namespace N2 {
+    struct Z {};
+    template<typename T> int *operator+(T, unsigned);
+  }
+
+  int main() {
+    N1::X<N2::Z> v;
+    v.f(0);
+  }
+}
+
+namespace dr385 { // dr385: yes
+  struct A { protected: void f(); }; 
+  struct B : A { using A::f; };
+  struct C : A { void g(B b) { b.f(); } };
+  void h(B b) { b.f(); }
+
+  struct D { int n; }; // expected-note {{member}}
+  struct E : protected D {}; // expected-note 2{{protected}}
+  struct F : E { friend int i(E); };
+  int i(E e) { return e.n; } // expected-error {{protected base}} expected-error {{protected member}}
+}
+
+namespace dr387 { // dr387: yes
+  namespace old {
+    template<typename T> class number {
+      number(int); // expected-note 2{{here}}
+      friend number gcd(number &x, number &y) {}
+    };
+
+    void g() {
+      number<double> a(3), b(4); // expected-error 2{{private}}
+      a = gcd(a, b);
+      b = gcd(3, 4); // expected-error {{undeclared}}
+    }
+  }
+
+  namespace newer {
+    template <typename T> class number {
+    public:
+      number(int);
+      friend number gcd(number x, number y) { return 0; }
+    };
+
+    void g() {
+      number<double> a(3), b(4);
+      a = gcd(a, b);
+      b = gcd(3, 4); // expected-error {{undeclared}}
+    }
+  }
+}
+
+// FIXME: dr388 needs codegen test

Modified: cfe/trunk/www/cxx_dr_status.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_dr_status.html?rev=203549&r1=203548&r2=203549&view=diff
==============================================================================
--- cfe/trunk/www/cxx_dr_status.html (original)
+++ cfe/trunk/www/cxx_dr_status.html Tue Mar 11 02:49:32 2014
@@ -1137,7 +1137,7 @@
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#183">183</a></td>
     <td>TC1</td>
     <td><TT>typename</TT> in explicit specializations</td>
-    <td class="none" align="center">Superseded by <a href="#382">382</a></td>
+    <td class="full" align="center">Superseded by <a href="#382">382</a></td>
   </tr>
   <tr id="184">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#184">184</a></td>
@@ -2327,31 +2327,31 @@ of class templates</td>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#381">381</a></td>
     <td>CD1</td>
     <td>Incorrect example of base class member lookup</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="382">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#382">382</a></td>
     <td>CD1</td>
     <td>Allow <TT>typename</TT> outside of templates</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes (C++11 onwards)</td>
   </tr>
   <tr id="383">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#383">383</a></td>
     <td>CD1</td>
     <td>Is a class with a declared but not defined destructor a POD?</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="384">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#384">384</a></td>
     <td>NAD</td>
     <td>Argument-dependent lookup and operator functions</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="385">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#385">385</a></td>
     <td>CD1</td>
     <td>How does protected member check of 11.5 interact with using-declarations?</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr class="open" id="386">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#386">386</a></td>
@@ -2363,7 +2363,7 @@ of class templates</td>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#387">387</a></td>
     <td>CD1</td>
     <td>Errors in example in 14.6.5</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="388">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#388">388</a></td>





More information about the cfe-commits mailing list