public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/41131]  New: non-lvalue in unary `&' wrongly accepted
@ 2009-08-20 15:12 sergei_lus at yahoo dot com
  2009-08-20 19:07 ` [Bug c++/41131] " jakub at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: sergei_lus at yahoo dot com @ 2009-08-20 15:12 UTC (permalink / raw)
  To: gcc-bugs

According to the iso 14882:1998 5.2.5 Class member access, the following code:

class X {
public:
        enum enumX { a=100 };
};
int main(void)
{
        X x;
        (void) &x.a;    // should not compile
        return  1;
}

should not compile, but with the following version of g++:
g++ -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --enable-threads=posix
--prefix=/prj/dsp/qdsp6_aus/users/slarin/x86_gcc_4.4/bin
--enable-languages=c,c++ --disable-checking
Thread model: posix
gcc version 4.4.0 (GCC)

... it does. Also failing in 4.3.2. In 3.3.3 and 3.4.6 for example it correctly
reports the following:

g++ reduced.c
reduced.c: In function `int main()':
reduced.c:11: error: non-lvalue in unary `&'


Thank you.


-- 
           Summary: non-lvalue in unary `&' wrongly accepted
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sergei_lus at yahoo dot com


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-01-02 16:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-20 15:12 [Bug c++/41131] New: non-lvalue in unary `&' wrongly accepted sergei_lus at yahoo dot com
2009-08-20 19:07 ` [Bug c++/41131] " jakub at gcc dot gnu dot org
2009-08-20 19:09 ` [Bug c++/41131] [4.3/4.4/4.5 Regression] " pinskia at gcc dot gnu dot org
2009-08-20 19:26 ` jakub at gcc dot gnu dot org
2009-08-20 22:03 ` jason at gcc dot gnu dot org
2009-08-20 22:04 ` pinskia at gcc dot gnu dot org
2009-08-21  7:08 ` jakub at gcc dot gnu dot org
2009-08-21  7:11 ` jakub at gcc dot gnu dot org
2009-08-21  7:24 ` [Bug c++/41131] [4.3 " jakub at gcc dot gnu dot org
2009-08-21 18:17 ` sergei_lus at yahoo dot com
2009-08-25 13:39 ` bangerth at gmail dot com
2009-08-31 16:46 ` jakub at gcc dot gnu dot org
2010-01-02 16:25 ` rguenth at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).