diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-01-19 22:50:02 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-01-19 22:50:02 +0000 |
commit | eb96af8a908ea28b2ca76e3848b2476852f592a6 (patch) | |
tree | 91372a851d3d87e5251598ef3b87d2e6851edba8 | |
parent | 796c1a1e3e63e459e371383ac878aa5f40b02a8c (diff) |
Further testing for instantiation of out-of-line constexpr static data member
template definitions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148506 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/CXX/class/class.static/class.static.data/p3.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/CXX/class/class.static/class.static.data/p3.cpp b/test/CXX/class/class.static/class.static.data/p3.cpp index 4d5ac470a0..fed715e219 100644 --- a/test/CXX/class/class.static/class.static.data/p3.cpp +++ b/test/CXX/class/class.static/class.static.data/p3.cpp @@ -32,9 +32,14 @@ struct U { // FIXME: It'd be nice to error on this at template definition time. static constexpr NonLit h = NonLit(); // expected-error 2{{must be initialized by a constant expression}} expected-note 2{{non-literal type}} static constexpr T c = T(); // expected-error {{must be initialized by a constant expression}} expected-note {{non-literal type}} + static const T d; }; +template<typename T> constexpr T U<T>::d = T(); // expected-error {{must be initialized by a constant expression}} expected-note {{non-literal type 'const NonLit'}} + U<int> u1; // expected-note {{here}} U<NonLit> u2; // expected-note {{here}} static_assert(U<int>::a == 0, ""); + +constexpr int outofline = (U<NonLit>::d, 0); // expected-note {{here}} expected-warning {{unused}} |