Commit 7b09c6a4 by Mark Mitchell Committed by Mark Mitchell

re PR c++/23839 (ICE: expected var_decl, have parm_decl in cxx_mark_addressable,…

re PR c++/23839 (ICE: expected var_decl, have parm_decl in cxx_mark_addressable, at cp/typeck.c:4343)

	PR c++/23839
	* typeck.c (cxx_mark_addressable): Only check DECL_HARD_REGISTER
	for VAR_DECLs.

	PR c++/23839
	* g++.dg/parse/register1.C: New test.

From-SVN: r104225
parent 6493555f
2005-09-13 Mark Mitchell <mark@codesourcery.com>
PR c++/23839
* typeck.c (cxx_mark_addressable): Only check DECL_HARD_REGISTER
for VAR_DECLs.
2005-09-13 Mark Mitchell <mark@codesourcery.com>
PR c++/23842
* pt.c (tsubst_default_argument): Do treat default argument
expressions as occurring in the context of the function called.
......
......@@ -4340,7 +4340,7 @@ cxx_mark_addressable (tree exp)
if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)
&& !DECL_ARTIFICIAL (x))
{
if (DECL_HARD_REGISTER (x) != 0)
if (TREE_CODE (x) == VAR_DECL && DECL_HARD_REGISTER (x))
{
error
("address of explicit register variable %qD requested", x);
......
2005-09-13 Mark Mitchell <mark@codesourcery.com>
PR c++/23839
* g++.dg/parse/register1.C: New test.
2005-09-13 Mark Mitchell <mark@codesourcery.com>
PR c++/23842
* g++.dg/template/access16.C: New test.
// PR c++/23839
class C
{
int i;
public:
C(int j) : i(j) { }
operator int() { return i; }
};
C f (register C x)
{
return x + 31;
}
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