* pt.c (tsubst_copy_and_build) [TARGET_EXPR]: New case.
[CONSTRUCTOR]: Use the tsubsted type.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166592
138bc75d-0d04-0410-961f-
82ee72b054a4
2010-11-10 Jason Merrill <jason@redhat.com>
+ PR c++/46420
+ * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: New case.
+ [CONSTRUCTOR]: Use the tsubsted type.
+
PR c++/46369
* semantics.c (cxx_eval_bit_field_ref): New.
(cxx_eval_constant_expression): Call it.
if (TREE_HAS_CONSTRUCTOR (t))
return finish_compound_literal (type, r);
+ TREE_TYPE (r) = type;
return r;
}
return build_lambda_object (r);
}
+ case TARGET_EXPR:
+ /* We can get here for a constant initializer of non-dependent type.
+ FIXME stop folding in cp_parser_initializer_clause. */
+ gcc_assert (TREE_CONSTANT (t));
+ return get_target_expr (RECUR (TARGET_EXPR_INITIAL (t)));
+
default:
/* Handle Objective-C++ constructs, if appropriate. */
{
+2010-11-10 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/constexpr-46420.C: New.
+
2010-11-10 Joseph Myers <joseph@codesourcery.com>
* g++.dg/ext/bitfield2.C, g++.dg/ext/bitfield4.C,
--- /dev/null
+// PR c++/46420
+// { dg-options -std=c++0x }
+
+template<typename> class vector { };
+struct A{};
+template <class T1>
+void complete_test(vector<T1> data1){
+ A drop=A();
+}
+int main(){
+ vector<double> vect1;
+ complete_test(vect1);
+}