Author: rsmith
Date: Thu Jan 19 16:50:02 2012
New Revision: 148506

URL: http://llvm.org/viewvc/llvm-project?rev=148506&view=rev
Log:
Further testing for instantiation of out-of-line constexpr static data member
template definitions.

Modified:
    cfe/trunk/test/CXX/class/class.static/class.static.data/p3.cpp

Modified: cfe/trunk/test/CXX/class/class.static/class.static.data/p3.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/class/class.static/class.static.data/p3.cpp?rev=148506&r1=148505&r2=148506&view=diff
==============================================================================
--- cfe/trunk/test/CXX/class/class.static/class.static.data/p3.cpp (original)
+++ cfe/trunk/test/CXX/class/class.static/class.static.data/p3.cpp Thu Jan 19 
16:50:02 2012
@@ -32,9 +32,14 @@
   // 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}}


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to