diff --git a/clang/test/CXX/drs/dr2xx.cpp b/clang/test/CXX/drs/dr2xx.cpp index c714acdff92a..3e9475600147 100644 --- a/clang/test/CXX/drs/dr2xx.cpp +++ b/clang/test/CXX/drs/dr2xx.cpp @@ -111,3 +111,109 @@ namespace dr215 { // dr215: yes void foo() { (void)+X().n; } }; } + +namespace dr216 { // dr216: no + // FIXME: Should reject this: 'f' has linkage but its type does not, + // and 'f' is odr-used but not defined in this TU. + typedef enum { e } *E; + void f(E); + void g(E e) { f(e); } + + struct S { + // FIXME: Should reject this: 'f' has linkage but its type does not, + // and 'f' is odr-used but not defined in this TU. + typedef enum { e } *E; + void f(E); + }; + void g(S s, S::E e) { s.f(e); } +} + +namespace dr217 { // dr217: yes + template struct S { + void f(int); + }; + template void S::f(int = 0) {} // expected-error {{default arguments cannot be added}} +} + +namespace dr218 { // dr218: yes + namespace A { + struct S {}; + void f(S); + } + namespace B { + struct S {}; + void f(S); + } + + struct C { + int f; + void test1(A::S as) { f(as); } // expected-error {{called object type 'int'}} + void test2(A::S as) { void f(); f(as); } // expected-error {{too many arguments}} expected-note {{}} + void test3(A::S as) { using A::f; f(as); } // ok + void test4(A::S as) { using B::f; f(as); } // ok + void test5(A::S as) { int f; f(as); } // expected-error {{called object type 'int'}} + void test6(A::S as) { struct f {}; (void) f(as); } // expected-error {{no matching conversion}} expected-note +{{}} + }; + + namespace D { + struct S {}; + struct X { void operator()(S); } f; + } + void testD(D::S ds) { f(ds); } // expected-error {{undeclared identifier}} + + namespace E { + struct S {}; + struct f { f(S); }; + } + void testE(E::S es) { f(es); } // expected-error {{undeclared identifier}} + + namespace F { + struct S { + template friend void f(S, T) {} + }; + } + void testF(F::S fs) { f(fs, 0); } + + namespace G { + namespace X { + int f; + struct A {}; + } + namespace Y { + template void f(T); + struct B {}; + } + template struct C {}; + } + void testG(G::C gc) { f(gc); } +} + +// dr219: na +// dr220: na + +namespace dr221 { // dr221: yes + struct A { + A &operator=(int&); + A &operator+=(int&); + static A &operator=(A&, double&); // expected-error {{cannot be a static member}} + static A &operator+=(A&, double&); // expected-error {{cannot be a static member}} + friend A &operator=(A&, char&); // expected-error {{must be a non-static member function}} + friend A &operator+=(A&, char&); + }; + A &operator=(A&, float&); // expected-error {{must be a non-static member function}} + A &operator+=(A&, float&); + + void test(A a, int n, char c, float f) { + a = n; + a += n; + a = c; + a += c; + a = f; + a += f; + } +} + +// 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. + +// dr223: na diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html index cb96ff31f2a5..258a5f8a8aa8 100644 --- a/clang/www/cxx_dr_status.html +++ b/clang/www/cxx_dr_status.html @@ -1335,37 +1335,37 @@ accessible? 216 CD1 Linkage of nameless class-scope enumeration types - Unknown + No 217 TC1 Default arguments for non-template member functions of class templates - Unknown + Yes 218 CD1 Specification of Koenig lookup - Unknown + Yes 219 NAD Cannot defend against destructors that throw exceptions - Unknown + N/A 220 CD1 All deallocation functions should be required not to throw - Unknown + N/A 221 CD1 Must compound assignment operators be member functions? - Unknown + Yes 222 @@ -1377,7 +1377,7 @@ accessible? 223 DRWP The meaning of deprecation - Unknown + N/A 224 diff --git a/clang/www/make_cxx_dr_status b/clang/www/make_cxx_dr_status index 62cc06f9dca8..d2527deb8c7c 100755 --- a/clang/www/make_cxx_dr_status +++ b/clang/www/make_cxx_dr_status @@ -131,6 +131,7 @@ def availability(issue): assert False, 'unknown status %s for issue %s' % (status, dr.issue) return (avail, avail_style) +count = {} for dr in drs: if dr.status in ('concepts',): # Yeah, cool story bro. @@ -144,6 +145,8 @@ for dr in drs: else: row_style = '' avail, avail_style = availability(dr.issue) + if not avail.startswith('Sup') and not avail.startswith('Dup'): + count[avail] = count.get(avail, 0) + 1 print >> out_file, '''\ @@ -154,6 +157,9 @@ for dr in drs: ''' % (row_style, dr.url, dr.issue, dr.status, dr.title, avail_style, avail) +for status, num in count.items(): + print "%s: %s" % (status, num) + print >> out_file, '''\