cxx_dr_status: update to latest issue list and add a couple more tests.

llvm-svn: 289255
This commit is contained in:
Richard Smith 2016-12-09 19:11:50 +00:00
parent 2c7d52a540
commit b11b087a85
3 changed files with 877 additions and 287 deletions

View File

@ -179,6 +179,45 @@ struct InheritsCtor : BaseCtor { // expected-note 1+ {{candidate}}
};
InheritsCtor II = {{}, 42}; // expected-error {{no matching constructor}}
namespace std_example {
struct A {
explicit A() = default; // expected-note 2{{declared here}}
};
struct B : A {
explicit B() = default; // expected-note 2{{declared here}}
};
struct C {
explicit C(); // expected-note 2{{declared here}}
};
struct D : A {
C c;
explicit D() = default; // expected-note 2{{declared here}}
};
template <typename T> void f() {
T t; // ok
T u{}; // ok
T v = {}; // expected-error 4{{explicit}}
}
template <typename T> void g() {
void x(T t); // expected-note 4{{parameter}}
x({}); // expected-error 4{{explicit}}
}
void test() {
f<A>(); // expected-note {{instantiation of}}
f<B>(); // expected-note {{instantiation of}}
f<C>(); // expected-note {{instantiation of}}
f<D>(); // expected-note {{instantiation of}}
g<A>(); // expected-note {{instantiation of}}
g<B>(); // expected-note {{instantiation of}}
g<C>(); // expected-note {{instantiation of}}
g<D>(); // expected-note {{instantiation of}}
}
}
#endif // __cplusplus >= 201103L
}

View File

@ -3,10 +3,6 @@
// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++1z -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
#if __cplusplus < 201103L
// expected-no-diagnostics
#endif
namespace dr1684 { // dr1684: 3.6
#if __cplusplus >= 201103L
struct NonLiteral { // expected-note {{because}}
@ -44,6 +40,35 @@ namespace dr1631 { // dr1631: 3.7
#endif
}
namespace dr1638 { // dr1638: yes
#if __cplusplus >= 201103L
template<typename T> struct A {
enum class E; // expected-note {{previous}}
enum class F : T; // expected-note 2{{previous}}
};
template<> enum class A<int>::E;
template<> enum class A<int>::E {};
template<> enum class A<int>::F : int;
template<> enum class A<int>::F : int {};
template<> enum class A<short>::E : int;
template<> enum class A<short>::E : int {};
template<> enum class A<short>::F; // expected-error {{different underlying type}}
template<> enum class A<char>::E : char; // expected-error {{different underlying type}}
template<> enum class A<char>::F : int; // expected-error {{different underlying type}}
enum class A<unsigned>::E; // expected-error {{template specialization requires 'template<>'}} expected-error {{nested name specifier}}
template enum class A<unsigned>::E; // expected-error {{enumerations cannot be explicitly instantiated}}
enum class A<unsigned>::E *e; // expected-error {{must use 'enum' not 'enum class'}}
struct B {
friend enum class A<unsigned>::E; // expected-error {{must use 'enum' not 'enum class'}}
};
#endif
}
namespace dr1645 { // dr1645: 3.9
#if __cplusplus >= 201103L
struct A { // expected-note 2{{candidate}}
@ -60,3 +85,19 @@ namespace dr1645 { // dr1645: 3.9
constexpr B b(0, 0); // expected-error {{ambiguous}}
#endif
}
namespace dr1653 { // dr1653: 4.0 c++17
void f(bool b) {
++b;
b++;
#if __cplusplus <= 201402L
// expected-warning@-3 {{deprecated}} expected-warning@-2 {{deprecated}}
#else
// expected-error@-5 {{incrementing expression of type bool}} expected-error@-4 {{incrementing expression of type bool}}
#endif
--b; // expected-error {{cannot decrement expression of type bool}}
b--; // expected-error {{cannot decrement expression of type bool}}
b += 1; // ok
b -= 1; // ok
}
}

File diff suppressed because it is too large Load Diff