This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/13941] ICE on illegal (void *) &&


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-31 03:11 -------
Actually this is invalid standard C++ but GNU adds an extension to take the address of an label by 
&&label which is what is happening here, if you used -pedantic-errors it would error out.  Anyways 
this is fixed for 3.4.0.  Nothing before 3.4.0 worked right.  Yes this is still invalid as you do not 
define a label called x though.  In fact here is a case which is valid GNU C++ which ICEs in version 
before 3.4.0:
class x{};
void fun(void*);
template<typename T>
x &operator<< (x &x, T s)
{
fun ((void *) &&x);
x:
return x;
}
int main()
{
  x t;
  t << t;
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13941


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]