Commit 29367844 by Jason Merrill Committed by Jason Merrill

re PR c++/49418 (G++ discards cv-quals from template parameter types)

	PR c++/49418
	* call.c (cxx_type_promotes_to): Don't strip cv-quals.
	* semantics.c (lambda_return_type): Strip them here.

From-SVN: r175271
parent e0a8ecf2
2011-06-21 Jason Merrill <jason@redhat.com>
PR c++/49418
* call.c (cxx_type_promotes_to): Don't strip cv-quals.
* semantics.c (lambda_return_type): Strip them here.
2011-06-21 Andrew MacLeod <amacleod@redhat.com>
* semantics.c: Add sync_ or SYNC__ to builtin names.
......
......@@ -2640,8 +2640,6 @@ type_decays_to (tree type)
return build_pointer_type (TREE_TYPE (type));
if (TREE_CODE (type) == FUNCTION_TYPE)
return build_pointer_type (type);
if (!MAYBE_CLASS_TYPE_P (type))
type = cv_unqualified (type);
return type;
}
......
......@@ -8177,7 +8177,7 @@ lambda_return_type (tree expr)
SET_TYPE_STRUCTURAL_EQUALITY (type);
}
else
type = type_decays_to (unlowered_expr_type (expr));
type = cv_unqualified (type_decays_to (unlowered_expr_type (expr)));
return type;
}
......
2011-06-21 Jason Merrill <jason@redhat.com>
PR c++/49418
* g++.dg/template/param3.C: New.
2011-06-21 Bernd Schmidt <bernds@codesourcery.com>
* gcc.c-torture/excute/builtin-bitops-1.c (MAKE_FUNS): Make
......
// PR c++/49418
template <class T>
void f (const T t)
{
t = 1; // { dg-error "" }
}
int main()
{
f(1);
}
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