Commit 30d1352e by Jason Merrill Committed by Jason Merrill

typeck2.c (build_functional_cast): Don't try to avoid calling build_value_init.

	* typeck2.c (build_functional_cast): Don't try to avoid calling
	build_value_init.
	* pt.c (instantiate_class_template_1): Don't copy TYPE_HAS_* flags.

From-SVN: r177999
parent f7d605ac
2011-08-23 Jason Merrill <jason@redhat.com>
* typeck2.c (build_functional_cast): Don't try to avoid calling
build_value_init.
* pt.c (instantiate_class_template_1): Don't copy TYPE_HAS_* flags.
2011-08-23 Jason Merrill <jason@redhat.com>
PR c++/49045
Core 1321
* tree.c (dependent_name): New.
......
......@@ -8503,16 +8503,6 @@ instantiate_class_template_1 (tree type)
input_location = DECL_SOURCE_LOCATION (TYPE_NAME (type)) =
DECL_SOURCE_LOCATION (typedecl);
TYPE_HAS_USER_CONSTRUCTOR (type) = TYPE_HAS_USER_CONSTRUCTOR (pattern);
TYPE_HAS_NEW_OPERATOR (type) = TYPE_HAS_NEW_OPERATOR (pattern);
TYPE_HAS_ARRAY_NEW_OPERATOR (type) = TYPE_HAS_ARRAY_NEW_OPERATOR (pattern);
TYPE_GETS_DELETE (type) = TYPE_GETS_DELETE (pattern);
TYPE_HAS_COPY_ASSIGN (type) = TYPE_HAS_COPY_ASSIGN (pattern);
TYPE_HAS_CONST_COPY_ASSIGN (type) = TYPE_HAS_CONST_COPY_ASSIGN (pattern);
TYPE_HAS_COPY_CTOR (type) = TYPE_HAS_COPY_CTOR (pattern);
TYPE_HAS_CONST_COPY_CTOR (type) = TYPE_HAS_CONST_COPY_CTOR (pattern);
TYPE_HAS_DEFAULT_CONSTRUCTOR (type) = TYPE_HAS_DEFAULT_CONSTRUCTOR (pattern);
TYPE_HAS_CONVERSION (type) = TYPE_HAS_CONVERSION (pattern);
TYPE_PACKED (type) = TYPE_PACKED (pattern);
TYPE_ALIGN (type) = TYPE_ALIGN (pattern);
TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (pattern);
......
......@@ -1677,10 +1677,7 @@ build_functional_cast (tree exp, tree parms, tsubst_flags_t complain)
void type, creates an rvalue of the specified type, which is
value-initialized. */
if (parms == NULL_TREE
/* If there's a user-defined constructor, value-initialization is
just calling the constructor, so fall through. */
&& !TYPE_HAS_USER_CONSTRUCTOR (type))
if (parms == NULL_TREE)
{
exp = build_value_init (type, complain);
exp = get_target_expr_sfinae (exp, complain);
......
2011-08-23 Jason Merrill <jason@redhat.com>
* g++.dg/template/crash7.C: Adjust expected errors.
2011-08-23 Jason Merrill <jason@redhat.com>
PR c++/49045
Core 1321
* g++.dg/cpp0x/overload2.C: New.
......
......@@ -5,10 +5,11 @@
// PR c++/10108: ICE in tsubst_decl for error due to non-existence
// nested type.
template <typename> struct A // { dg-message "A.void.::A.const A" }
template <typename> struct A
{
template <typename> A(typename A::X) {} // { dg-error "no type" }
};
A<void> a; // { dg-error "required|no match" }
// { dg-prune-output "note" }
// We currently don't give the "no match" error because we don't add the
// invalid constructor template to TYPE_METHODS.
A<void> a; // { dg-message "required" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment