summaryrefslogtreecommitdiffstats
path: root/test/CXX/drs/dr2xx.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-01-18 16:23:48 +0000
committerdim <dim@FreeBSD.org>2015-01-18 16:23:48 +0000
commitc86b984ea8ecb3e944dc3de48539f4c1f65851ea (patch)
tree3eb853da77d46cc77c4b017525a422f9ddb1385b /test/CXX/drs/dr2xx.cpp
parentc696171ff15f0ee60dea4abfd99a135473c95656 (diff)
downloadFreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.zip
FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.tar.gz
Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc1@226102
Diffstat (limited to 'test/CXX/drs/dr2xx.cpp')
-rw-r--r--test/CXX/drs/dr2xx.cpp46
1 files changed, 34 insertions, 12 deletions
diff --git a/test/CXX/drs/dr2xx.cpp b/test/CXX/drs/dr2xx.cpp
index bb9af9f..bb1f13a 100644
--- a/test/CXX/drs/dr2xx.cpp
+++ b/test/CXX/drs/dr2xx.cpp
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++1y %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// PR13819 -- __SIZE_TYPE__ is incompatible.
typedef __SIZE_TYPE__ size_t; // expected-error 0-1 {{extension}}
@@ -195,8 +196,8 @@ namespace dr218 { // dr218: yes
// dr220: na
namespace dr221 { // dr221: yes
- struct A {
- A &operator=(int&);
+ struct A { // expected-note 2-4{{candidate}}
+ A &operator=(int&); // expected-note 2{{candidate}}
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}}
@@ -209,9 +210,9 @@ namespace dr221 { // dr221: yes
void test(A a, int n, char c, float f) {
a = n;
a += n;
- a = c;
+ a = c; // expected-error {{no viable}}
a += c;
- a = f;
+ a = f; // expected-error {{no viable}}
a += f;
}
}
@@ -466,7 +467,7 @@ namespace dr243 { // dr243: yes
A a2 = b; // expected-error {{ambiguous}}
}
-namespace dr244 { // dr244: 3.5
+namespace dr244 { // dr244: partial
struct B {}; struct D : B {}; // expected-note {{here}}
D D_object;
@@ -484,6 +485,28 @@ namespace dr244 { // dr244: 3.5
B_ptr->dr244::~B(); // expected-error {{refers to a member in namespace}}
B_ptr->dr244::~B_alias(); // expected-error {{refers to a member in namespace}}
}
+
+ namespace N {
+ template<typename T> struct E {};
+ typedef E<int> F;
+ }
+ void g(N::F f) {
+ typedef N::F G;
+ f.~G();
+ f.G::~E();
+ f.G::~F(); // expected-error {{expected the class name after '~' to name a destructor}}
+ f.G::~G();
+ // This is technically ill-formed; E is looked up in 'N::' and names the
+ // class template, not the injected-class-name of the class. But that's
+ // probably a bug in the standard.
+ f.N::F::~E();
+ // This is valid; we look up the second F in the same scope in which we
+ // found the first one, that is, 'N::'.
+ f.N::F::~F(); // FIXME: expected-error {{expected the class name after '~' to name a destructor}}
+ // This is technically ill-formed; G is looked up in 'N::' and is not found;
+ // as above, this is probably a bug in the standard.
+ f.N::F::~G();
+ }
}
namespace dr245 { // dr245: yes
@@ -499,7 +522,7 @@ namespace dr246 { // dr246: yes
throw 0;
X: ;
} catch (int) {
- goto X; // expected-error {{protected scope}}
+ goto X; // expected-error {{cannot jump}}
}
};
}
@@ -968,12 +991,11 @@ namespace dr289 { // dr289: yes
namespace dr294 { // dr294: no
void f() throw(int);
int main() {
- // FIXME: we reject this for the wrong reason, because we don't implement
- // dr87 yet.
- (void)static_cast<void (*)() throw()>(f); // expected-error {{not superset}}
- void (*p)() throw() = f; // expected-error {{not superset}}
-
+ (void)static_cast<void (*)() throw()>(f); // FIXME: ill-formed
(void)static_cast<void (*)() throw(int)>(f); // FIXME: ill-formed
+
+ void (*p)() throw() = f; // expected-error {{not superset}}
+ void (*q)() throw(int) = f;
}
}
OpenPOWER on IntegriCloud