[Bug c++/41039] New: Member reordering rule is overly strict

2009-08-11 Thread coppro at users dot sf dot net
The check for declarations that could, if reordered within a class, alter the
meaning of that class (and thus be ill-formed) is overly restrictive.
Specifically, it bans any declaration that might cause such an issue, while a
program is ill-formed only if the reordering would actually cause an ambiguity.

The following is not valid

struct foo { };
struct bar {
  foo f;
  foo foo();
}

because if you rearrange the definitions within bar, the program's meaning
might change.

The following, however, is

struct foo { };
struct bar {
  foo foo();
}

because there is nothing to reorder, so the meaning of bar cannot possibly
change.


-- 
   Summary: Member reordering rule is overly strict
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: coppro at users dot sf dot net


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



[Bug c++/41039] Member reordering rule is overly strict

2009-08-11 Thread coppro at users dot sf dot net


--- Comment #2 from coppro at users dot sf dot net  2009-08-12 06:26 ---
[basic.scope.class]:
3) If reordering member declarations in a class yields an alternate valid
program under (1) and (2), the program is ill-formed, no diagnostic is
required.

Otherwise, the program is well-formed, and while a warning is nice, it's not
correct for GCC to reject this code.


-- 


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



[Bug c++/41039] Member reordering rule is overly strict

2009-08-13 Thread coppro at users dot sf dot net


--- Comment #5 from coppro at users dot sf dot net  2009-08-14 05:41 ---
Jonathan Wakely appears to be correct. My apologies!


-- 

coppro at users dot sf dot net changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


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



[Bug pch/41346] New: Precompiled headers from stdin don't work

2009-09-12 Thread coppro at users dot sf dot net
Trying to compile a precompiled header from stdin (e.g. "gcc -x c-header -")
causes the following message (with a different filename each time):

:1: fatal error: error closing /tmp/ccoH8xmg.s: Bad file descriptor
compilation terminated.

This makes it very difficult to test for PCH support in autoconf.


-- 
   Summary: Precompiled headers from stdin don't work
   Product: gcc
   Version: 4.4.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: pch
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: coppro at users dot sf dot net


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