[Bug c++/23840] [3.4/4.0/4.1 Regression] Bogus "invalid lvalue in unary '&'" diagnostic and ICE with va_arg

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Sep 12 20:15:00 GMT 2005


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-12 20:15 -------
Confirmed.  Hmm, I don't think this is defined code as you are trying to get a non-POD from a va_args.
But we should not reject this as it is only undefined.
Reduced testcae:
#include <stdarg.h>
struct S
{
  int f(int n) { return n; }
};
void f(va_list ap)
{
  va_arg(ap, S).f(0);
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-checking, ice-on-valid-
                   |                            |code, rejects-valid
      Known to fail|                            |4.0.0 4.1.0 3.4.0
      Known to work|                            |3.3.3
   Last reconfirmed|0000-00-00 00:00:00         |2005-09-12 20:15:48
               date|                            |
   Target Milestone|---                         |4.0.2


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



More information about the Gcc-bugs mailing list