&& !DECL_INITIAL (d)
&& DECL_INITIAL (code_pattern))
{
- tree ns = decl_namespace_context (d);
+ tree ns;
+ tree init;
+
+ ns = decl_namespace_context (d);
push_nested_namespace (ns);
push_nested_class (DECL_CONTEXT (d));
- DECL_INITIAL (d)
- = tsubst_expr (DECL_INITIAL (code_pattern),
- args,
- tf_error | tf_warning, NULL_TREE);
+ init = tsubst_expr (DECL_INITIAL (code_pattern),
+ args,
+ tf_error | tf_warning, NULL_TREE);
+ DECL_INITIAL (d) = NULL_TREE;
+ finish_static_data_member_decl (d, init,
+ /*asmspec_tree=*/NULL_TREE,
+ LOOKUP_ONLYCONVERTING);
pop_nested_class ();
pop_nested_namespace (ns);
}
--- /dev/null
+// PR c++/24277
+
+template< int Bits > struct uint_t {
+ typedef unsigned short fast;
+};
+template < int Bits > struct mask_uint_t {
+ typedef typename uint_t< Bits >::fast fast;
+ static const fast sig_bits = 1;
+ static const fast sig_bits_fast = fast(sig_bits);
+};
+template < int Bits> int checksum ( ) {
+ return 1 & mask_uint_t<Bits>::sig_bits_fast;
+}
+int i = checksum<1>();