public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/40372] [4.4/4.5 Regression] ICE with invalid use of non-static data members
  2009-06-07 20:42 [Bug c++/40372] New: [4.4/4.5 Regression] ICE with invalid use of non-static data members reichelt at gcc dot gnu dot org
@ 2009-06-07 20:42 ` reichelt at gcc dot gnu dot org
  2009-06-08  8:58 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-06-07 20:42 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.4.1


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


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

* [Bug c++/40372]  New: [4.4/4.5 Regression] ICE with invalid use of non-static data members
@ 2009-06-07 20:42 reichelt at gcc dot gnu dot org
  2009-06-07 20:42 ` [Bug c++/40372] " reichelt at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-06-07 20:42 UTC (permalink / raw)
  To: gcc-bugs

The following invalid code snippet triggers an ICE since GCC 4.4.0:

======================================
template<int> struct A
{
  int i;
  friend void foo() { int x[i]; }
};

struct B
{
  int j;
  friend int bar() { return j; }
};
======================================

bug.cc: In function 'void foo()':
bug.cc:3:7: error: invalid use of non-static data member 'A<<anonymous> >::i'
bug.cc:4:29: error: from this location
bug.cc: In function 'int bar()':
bug.cc:9:7: error: invalid use of non-static data member 'B::j'
bug.cc:10:29: error: from this location
bug.cc:10:29: internal compiler error: tree check: expected class 'expression',
have 'exceptional' (error_mark) in fold_build_cleanup_point_expr, at
fold-const.c:15537
Please submit a full bug report, [etc.]


-- 
           Summary: [4.4/4.5 Regression] ICE with invalid use of non-static
                    data members
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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

* [Bug c++/40372] [4.4/4.5 Regression] ICE with invalid use of non-static data members
  2009-06-07 20:42 [Bug c++/40372] New: [4.4/4.5 Regression] ICE with invalid use of non-static data members reichelt at gcc dot gnu dot org
  2009-06-07 20:42 ` [Bug c++/40372] " reichelt at gcc dot gnu dot org
@ 2009-06-08  8:58 ` jakub at gcc dot gnu dot org
  2009-06-08 16:26 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-06-08  8:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jakub at gcc dot gnu dot org  2009-06-08 08:58 -------
Caused by PR28879 (r144988) fix.  build_nop doesn't build a NOP_EXPR if
the argument or its type is error_mark_node, so:
13318  /* Remember this wasn't a constant-expression.  */
13319  bounds = build_nop (TREE_TYPE (bounds), bounds);
13320  TREE_SIDE_EFFECTS (bounds) = 1;
would set TREE_SIDE_EFFECTS (error_mark_node).  Which of course breaks a lot of
code everywhere.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-06-08 08:58:06
               date|                            |


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


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

* [Bug c++/40372] [4.4/4.5 Regression] ICE with invalid use of non-static data members
  2009-06-07 20:42 [Bug c++/40372] New: [4.4/4.5 Regression] ICE with invalid use of non-static data members reichelt at gcc dot gnu dot org
  2009-06-07 20:42 ` [Bug c++/40372] " reichelt at gcc dot gnu dot org
  2009-06-08  8:58 ` jakub at gcc dot gnu dot org
@ 2009-06-08 16:26 ` jakub at gcc dot gnu dot org
  2009-06-08 16:31 ` jakub at gcc dot gnu dot org
  2009-06-08 16:40 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-06-08 16:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2009-06-08 16:26 -------
Subject: Bug 40372

Author: jakub
Date: Mon Jun  8 16:26:01 2009
New Revision: 148278

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=148278
Log:
        PR c++/40370
        PR c++/40372
        * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
        on error_mark_node.  Check for VLAs outside of function context
        before check whether to wrap bounds into a NOP_EXPR with
        TREE_SIDE_EFFECTS.

        * g++.dg/template/error41.C: New test.
        * g++.dg/template/error42.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/template/error41.C
    trunk/gcc/testsuite/g++.dg/template/error42.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/40372] [4.4/4.5 Regression] ICE with invalid use of non-static data members
  2009-06-07 20:42 [Bug c++/40372] New: [4.4/4.5 Regression] ICE with invalid use of non-static data members reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-06-08 16:26 ` jakub at gcc dot gnu dot org
@ 2009-06-08 16:31 ` jakub at gcc dot gnu dot org
  2009-06-08 16:40 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-06-08 16:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2009-06-08 16:31 -------
Subject: Bug 40372

Author: jakub
Date: Mon Jun  8 16:31:07 2009
New Revision: 148281

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=148281
Log:
        PR c++/40370
        PR c++/40372
        * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
        on error_mark_node.  Check for VLAs outside of function context
        before check whether to wrap bounds into a NOP_EXPR with
        TREE_SIDE_EFFECTS.

        * g++.dg/template/error41.C: New test.
        * g++.dg/template/error42.C: New test.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/error41.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/error42.C
Modified:
    branches/gcc-4_4-branch/gcc/cp/ChangeLog
    branches/gcc-4_4-branch/gcc/cp/parser.c
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/40372] [4.4/4.5 Regression] ICE with invalid use of non-static data members
  2009-06-07 20:42 [Bug c++/40372] New: [4.4/4.5 Regression] ICE with invalid use of non-static data members reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2009-06-08 16:31 ` jakub at gcc dot gnu dot org
@ 2009-06-08 16:40 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-06-08 16:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2009-06-08 16:40 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2009-06-08 16:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-07 20:42 [Bug c++/40372] New: [4.4/4.5 Regression] ICE with invalid use of non-static data members reichelt at gcc dot gnu dot org
2009-06-07 20:42 ` [Bug c++/40372] " reichelt at gcc dot gnu dot org
2009-06-08  8:58 ` jakub at gcc dot gnu dot org
2009-06-08 16:26 ` jakub at gcc dot gnu dot org
2009-06-08 16:31 ` jakub at gcc dot gnu dot org
2009-06-08 16:40 ` jakub 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).