aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/drs/dr0xx.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-01-18 16:23:48 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-01-18 16:23:48 +0000
commit06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 (patch)
tree3eb853da77d46cc77c4b017525a422f9ddb1385b /test/CXX/drs/dr0xx.cpp
parent30d791273d07fac9c0c1641a0731191bca6e8606 (diff)
downloadsrc-06d4ba388873e6d1cfa9cd715a8935ecc8cd2097.tar.gz
src-06d4ba388873e6d1cfa9cd715a8935ecc8cd2097.zip
Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1):vendor/clang/clang-release_360-r226102
Notes
Notes: svn path=/vendor/clang/dist/; revision=277325 svn path=/vendor/clang/clang-release_360-r226102/; revision=277326; tag=vendor/clang/clang-release_360-r226102
Diffstat (limited to 'test/CXX/drs/dr0xx.cpp')
-rw-r--r--test/CXX/drs/dr0xx.cpp40
1 files changed, 28 insertions, 12 deletions
diff --git a/test/CXX/drs/dr0xx.cpp b/test/CXX/drs/dr0xx.cpp
index 29e1720b1bbf..5b34cc3380c1 100644
--- a/test/CXX/drs/dr0xx.cpp
+++ b/test/CXX/drs/dr0xx.cpp
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -Wno-bind-to-temporary-copy
// 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
namespace dr1 { // dr1: no
namespace X { extern "C" void dr1_f(int a = 1); }
@@ -520,17 +521,28 @@ namespace dr48 { // dr48: yes
}
namespace dr49 { // dr49: yes
- template<int*> struct A {}; // expected-note {{here}}
+ template<int*> struct A {}; // expected-note 0-2{{here}}
int k;
#if __has_feature(cxx_constexpr)
constexpr
#endif
- int *const p = &k;
+ int *const p = &k; // expected-note 0-2{{here}}
A<&k> a;
- A<p> b; // expected-error {{must have its address taken}}
+ A<p> b;
+#if __cplusplus <= 201402L
+ // expected-error@-2 {{must have its address taken}}
+#endif
+#if __cplusplus < 201103L
+ // expected-error@-5 {{internal linkage}}
+#endif
+ int *q = &k;
+ A<q> c;
#if __cplusplus < 201103L
- // expected-error@-2 {{internal linkage}}
- // expected-note@-5 {{here}}
+ // expected-error@-2 {{must have its address taken}}
+#else
+ // expected-error@-4 {{constant expression}}
+ // expected-note@-5 {{read of non-constexpr}}
+ // expected-note@-7 {{declared here}}
#endif
}
@@ -822,7 +834,7 @@ namespace dr70 { // dr70: yes
namespace dr73 { // dr73: no
// The resolution to dr73 is unworkable. Consider:
int a, b;
- static_assert(&a + 1 != &b, "");
+ static_assert(&a + 1 != &b, ""); // expected-error {{not an integral constant expression}}
}
#endif
@@ -852,7 +864,7 @@ namespace dr77 { // dr77: yes
namespace dr78 { // dr78: sup ????
// Under DR78, this is valid, because 'k' has static storage duration, so is
// zero-initialized.
- const int k; // expected-error {{default initialization of an object of const}}
+ const int k; // expected-error {{default initialization of an object of const}} expected-note{{add an explicit initializer to initialize 'k'}}
}
// dr79: na
@@ -994,6 +1006,10 @@ namespace dr92 { // dr92: yes
g(q); // expected-error {{is not superset}}
}
+ // Prior to C++17, this is OK because the exception specification is not
+ // considered in this context. In C++17, we *do* perform an implicit
+ // conversion (which performs initialization), but we convert to the type of
+ // the template parameter, which does not include the exception specification.
template<void() throw()> struct X {};
X<&f> xp; // ok
}
@@ -1051,18 +1067,18 @@ namespace dr98 { // dr98: yes
void test(int n) {
switch (n) {
try { // expected-note 2{{bypasses}}
- case 0: // expected-error {{protected}}
+ case 0: // expected-error {{cannot jump}}
x:
throw n;
} catch (...) { // expected-note 2{{bypasses}}
- case 1: // expected-error {{protected}}
+ case 1: // expected-error {{cannot jump}}
y:
throw n;
}
case 2:
- goto x; // expected-error {{protected}}
+ goto x; // expected-error {{cannot jump}}
case 3:
- goto y; // expected-error {{protected}}
+ goto y; // expected-error {{cannot jump}}
}
}
}