From fed2603a98c8898cff5dec4b935a00bb9f4d8ecc Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 7 Nov 2013 19:26:14 +0000 Subject: [PATCH] Tests for CWG issue 165-170. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194215 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CXX/drs/dr1xx.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++ www/cxx_dr_status.html | 8 +++---- 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/test/CXX/drs/dr1xx.cpp b/test/CXX/drs/dr1xx.cpp index 646bc1b5ce..e06034b8d9 100644 --- a/test/CXX/drs/dr1xx.cpp +++ b/test/CXX/drs/dr1xx.cpp @@ -670,3 +670,57 @@ namespace dr165 { // dr165: no // FIXME: dr165 says this is ill-formed, but the argument in dr1477 says it's ok void N::g() {} } + +namespace dr166 { // dr166: yes + namespace A { class X; } + + template int f(T t) { return t.n; } + int g(A::X); + template int h(T t) { return t.n; } // expected-error {{private}} + int i(A::X); + + namespace A { + class X { + friend int f(X); + friend int dr166::g(X); + friend int h(X); + friend int i(X); + int n; // expected-note 2{{here}} + }; + + int h(X x) { return x.n; } + int i(X x) { return x.n; } + } + + template int f(A::X); + int g(A::X x) { return x.n; } + template int h(A::X); // expected-note {{instantiation}} + int i(A::X x) { return x.n; } // expected-error {{private}} +} + +// dr167: sup 1012 + +namespace dr168 { // dr168: no + extern "C" typedef int (*p)(); + extern "C++" typedef int (*q)(); + struct S { + static int f(); + }; + p a = &S::f; // FIXME: this should fail. + q b = &S::f; +} + +namespace dr169 { // dr169: yes + template struct A { int n; }; + struct B { + template struct C; + template void f(); + template static int n; // expected-error 0-1{{extension}} + }; + struct D : A, B { + using A::n; + using B::C; // expected-error {{using declaration can not refer to a template specialization}} + using B::f; // expected-error {{using declaration can not refer to a template specialization}} + using B::n; // expected-error {{using declaration can not refer to a template specialization}} + }; +} diff --git a/www/cxx_dr_status.html b/www/cxx_dr_status.html index 8c4bde8ead..42d0cb9985 100644 --- a/www/cxx_dr_status.html +++ b/www/cxx_dr_status.html @@ -1034,25 +1034,25 @@ 166 TC1 Friend declarations of template-ids - Unknown + Yes 167 NAD Deprecating static functions - Unknown + Superseded by 1012 168 NAD C linkage for static member functions - Unknown + No 169 NAD template-ids in using-declarations - Unknown + Yes 170 -- 2.50.0