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
This commit is contained in:
parent
6493555fd3
commit
7b09c6a499
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -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);
|
||||
|
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
14
gcc/testsuite/g++.dg/parse/register1.C
Normal file
14
gcc/testsuite/g++.dg/parse/register1.C
Normal file
@ -0,0 +1,14 @@
|
||||
// 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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user