With -ansi -pedantic-errors, GCC fails to reject the following assignment.

struct foo s;
volatile struct foo t;
struct foo { const int z; };

void bar (void)
{
  t = s;
}

GCC is tricked by the delayed completion of a qualified form of the type.

-- 
           Summary: Failure to diagnose violation of constraint 6.516p2
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: neil at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to