public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/26036]  New: Treating a class object as a function with member variables causes hang
@ 2006-01-30 16:49 ben at pc-doctor dot com
  2006-01-30 17:41 ` [Bug c++/26036] " ben at pc-doctor dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: ben at pc-doctor dot com @ 2006-01-30 16:49 UTC (permalink / raw)
  To: gcc-bugs

The following code, while invalid, causes g++ >= 4.0.0 to hang while compiling.
 Please note that "i" is also undeclared.  GCC 3.4.4 errors out as expected.


class TestClass {
public:
        int m_z;
};

class WrapperClass {
public:
        TestClass m_test;
};

int main()
{
   WrapperClass wrapper0(TestClass(i));
   return wrapper0().m_test.m_z++;
}


-- 
           Summary: Treating a class object as a function with member
                    variables causes hang
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ben at pc-doctor dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug c++/26036] Treating a class object as a function with member variables causes hang
  2006-01-30 16:49 [Bug c++/26036] New: Treating a class object as a function with member variables causes hang ben at pc-doctor dot com
@ 2006-01-30 17:41 ` ben at pc-doctor dot com
  2006-01-30 18:07 ` [Bug c++/26036] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ben at pc-doctor dot com @ 2006-01-30 17:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ben at pc-doctor dot com  2006-01-30 17:41 -------
(In reply to comment #0)
>  Please note that "i" is also undeclared. 
Err, i is not a variable.... so ignore that statement.  I am assuming gcc is
treating the "WrapperClass wrapper0(TestClass(i));" as a declaration instead of
instantiation.  Still, the compiler should not hang.


-- 


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


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

* [Bug c++/26036] [4.0/4.1/4.2 Regression] Treating a class object as a function with member variables causes hang
  2006-01-30 16:49 [Bug c++/26036] New: Treating a class object as a function with member variables causes hang ben at pc-doctor dot com
  2006-01-30 17:41 ` [Bug c++/26036] " ben at pc-doctor dot com
@ 2006-01-30 18:07 ` pinskia at gcc dot gnu dot org
  2006-01-31  2:44 ` mmitchel at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-30 18:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-01-30 18:07 -------
I don't get a hang but I do get an ICE after some errors.


Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
  GCC build triplet|i686-pc-linux-gnu           |
   GCC host triplet|i686-pc-linux-gnu           |
 GCC target triplet|i686-pc-linux-gnu           |
           Keywords|                            |error-recovery, ice-on-
                   |                            |invalid-code
      Known to fail|                            |4.0.3 4.1.0 4.2.0
      Known to work|                            |3.4.0 3.3.3
   Last reconfirmed|0000-00-00 00:00:00         |2006-01-30 18:07:47
               date|                            |
            Summary|Treating a class object as a|[4.0/4.1/4.2 Regression]
                   |function with member        |Treating a class object as a
                   |variables causes hang       |function with member
                   |                            |variables causes hang
   Target Milestone|---                         |4.1.0


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


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

* [Bug c++/26036] [4.0/4.1/4.2 Regression] Treating a class object as a function with member variables causes hang
  2006-01-30 16:49 [Bug c++/26036] New: Treating a class object as a function with member variables causes hang ben at pc-doctor dot com
  2006-01-30 17:41 ` [Bug c++/26036] " ben at pc-doctor dot com
  2006-01-30 18:07 ` [Bug c++/26036] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-01-31  2:44 ` mmitchel at gcc dot gnu dot org
  2006-02-02  9:55 ` reichelt at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-31  2:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from mmitchel at gcc dot gnu dot org  2006-01-31 02:44 -------
This is a relatively low priority regression; we get valid errors before the
crash.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED
           Priority|P3                          |P2


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


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

* [Bug c++/26036] [4.0/4.1/4.2 Regression] Treating a class object as a function with member variables causes hang
  2006-01-30 16:49 [Bug c++/26036] New: Treating a class object as a function with member variables causes hang ben at pc-doctor dot com
                   ` (2 preceding siblings ...)
  2006-01-31  2:44 ` mmitchel at gcc dot gnu dot org
@ 2006-02-02  9:55 ` reichelt at gcc dot gnu dot org
  2006-02-24  0:31 ` mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-02-02  9:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from reichelt at gcc dot gnu dot org  2006-02-02 09:54 -------
Here's a simpler testcase with only one error:

=======================
struct A
{
    int i;
};

A foo(int);

void bar()
{
    foo().i;
}
=======================


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
           Keywords|                            |monitored


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


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

* [Bug c++/26036] [4.0/4.1/4.2 Regression] Treating a class object as a function with member variables causes hang
  2006-01-30 16:49 [Bug c++/26036] New: Treating a class object as a function with member variables causes hang ben at pc-doctor dot com
                   ` (3 preceding siblings ...)
  2006-02-02  9:55 ` reichelt at gcc dot gnu dot org
@ 2006-02-24  0:31 ` mmitchel at gcc dot gnu dot org
  2006-04-19  9:34 ` reichelt at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-02-24  0:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from mmitchel at gcc dot gnu dot org  2006-02-24 00:26 -------
This issue will not be resolved in GCC 4.1.0; retargeted at GCC 4.1.1.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.0                       |4.1.1


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


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

* [Bug c++/26036] [4.0/4.1/4.2 Regression] Treating a class object as a function with member variables causes hang
  2006-01-30 16:49 [Bug c++/26036] New: Treating a class object as a function with member variables causes hang ben at pc-doctor dot com
                   ` (4 preceding siblings ...)
  2006-02-24  0:31 ` mmitchel at gcc dot gnu dot org
@ 2006-04-19  9:34 ` reichelt at gcc dot gnu dot org
  2006-04-19 16:57 ` mark at codesourcery dot com
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-04-19  9:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from reichelt at gcc dot gnu dot org  2006-04-19 09:34 -------
Mark,
are you really working on this one or did you only accidentally assign the PR
to
you? The following fixes the problem for me and allows to get rid of
error_mark_list as it is then unused:

===================================================================
--- gcc/gcc/cp/typeck.c 2006-04-18 17:32:06 +0200
+++ gcc/gcc/cp/typeck.c 2006-04-18 17:32:31 +0200
@@ -2788,7 +2788,7 @@ convert_arguments (tree typelist, tree v
            }
          else
            error ("too few arguments to function");
-         return error_mark_list;
+         return error_mark_node;
        }
     }

===================================================================


-- 


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


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

* [Bug c++/26036] [4.0/4.1/4.2 Regression] Treating a class object as a function with member variables causes hang
  2006-01-30 16:49 [Bug c++/26036] New: Treating a class object as a function with member variables causes hang ben at pc-doctor dot com
                   ` (5 preceding siblings ...)
  2006-04-19  9:34 ` reichelt at gcc dot gnu dot org
@ 2006-04-19 16:57 ` mark at codesourcery dot com
  2006-04-19 17:37 ` reichelt at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mark at codesourcery dot com @ 2006-04-19 16:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from mark at codesourcery dot com  2006-04-19 16:57 -------
Subject: Re:  [4.0/4.1/4.2 Regression] Treating a class object
 as a function with member variables causes hang

reichelt at gcc dot gnu dot org wrote:
> ------- Comment #6 from reichelt at gcc dot gnu dot org  2006-04-19 09:34 -------
> Mark,
> are you really working on this one or did you only accidentally assign the PR
> to
> you? 

Well, I planned to fix it before the next release, but I wasn't actually
doing anything on it.  You're always welcome to fix my bugs. :-)

> The following fixes the problem for me and allows to get rid of
> error_mark_list as it is then unused:
> 
> ===================================================================
> --- gcc/gcc/cp/typeck.c 2006-04-18 17:32:06 +0200
> +++ gcc/gcc/cp/typeck.c 2006-04-18 17:32:31 +0200
> @@ -2788,7 +2788,7 @@ convert_arguments (tree typelist, tree v
>             }
>           else
>             error ("too few arguments to function");
> -         return error_mark_list;
> +         return error_mark_node;
>         }
>      }

I can't argue with that. :-)  This patch, and the removal of
error_mark_list are fine.

Thanks,


-- 


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


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

* [Bug c++/26036] [4.0/4.1/4.2 Regression] Treating a class object as a function with member variables causes hang
  2006-01-30 16:49 [Bug c++/26036] New: Treating a class object as a function with member variables causes hang ben at pc-doctor dot com
                   ` (6 preceding siblings ...)
  2006-04-19 16:57 ` mark at codesourcery dot com
@ 2006-04-19 17:37 ` reichelt at gcc dot gnu dot org
  2006-04-19 17:40 ` reichelt at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-04-19 17:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from reichelt at gcc dot gnu dot org  2006-04-19 17:37 -------
Subject: Bug 26036

Author: reichelt
Date: Wed Apr 19 17:36:59 2006
New Revision: 113087

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113087
Log:
        PR c++/26036
        * typeck.c (convert_arguments): Return error_mark_node instead of
        error_mark_list.
        * cp-tree.h (error_mark_list): Remove declaration.
        * decl.c (error_mark_list): Remove definition.
        (cxx_init_decl_processing): Do not initialize error_mark_list.

        * g++.dg/expr/call3.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/expr/call3.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/26036] [4.0/4.1/4.2 Regression] Treating a class object as a function with member variables causes hang
  2006-01-30 16:49 [Bug c++/26036] New: Treating a class object as a function with member variables causes hang ben at pc-doctor dot com
                   ` (7 preceding siblings ...)
  2006-04-19 17:37 ` reichelt at gcc dot gnu dot org
@ 2006-04-19 17:40 ` reichelt at gcc dot gnu dot org
  2006-04-19 17:43 ` reichelt at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-04-19 17:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from reichelt at gcc dot gnu dot org  2006-04-19 17:40 -------
Subject: Bug 26036

Author: reichelt
Date: Wed Apr 19 17:40:27 2006
New Revision: 113088

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113088
Log:
        PR c++/26036
        * typeck.c (convert_arguments): Return error_mark_node instead of
        error_mark_list.
        * cp-tree.h (error_mark_list): Remove declaration.
        * decl.c (error_mark_list): Remove definition.
        (cxx_init_decl_processing): Do not initialize error_mark_list.

        * g++.dg/expr/call3.C: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/expr/call3.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/cp-tree.h
    branches/gcc-4_1-branch/gcc/cp/decl.c
    branches/gcc-4_1-branch/gcc/cp/typeck.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/26036] [4.0/4.1/4.2 Regression] Treating a class object as a function with member variables causes hang
  2006-01-30 16:49 [Bug c++/26036] New: Treating a class object as a function with member variables causes hang ben at pc-doctor dot com
                   ` (8 preceding siblings ...)
  2006-04-19 17:40 ` reichelt at gcc dot gnu dot org
@ 2006-04-19 17:43 ` reichelt at gcc dot gnu dot org
  2006-04-19 17:46 ` reichelt at gcc dot gnu dot org
  2006-04-19 17:50 ` patchapp at dberlin dot org
  11 siblings, 0 replies; 13+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-04-19 17:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from reichelt at gcc dot gnu dot org  2006-04-19 17:43 -------
Subject: Bug 26036

Author: reichelt
Date: Wed Apr 19 17:43:01 2006
New Revision: 113089

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113089
Log:
        PR c++/26036
        * typeck.c (convert_arguments): Return error_mark_node instead of
        error_mark_list.
        * cp-tree.h (error_mark_list): Remove declaration.
        * decl.c (error_mark_list): Remove definition.
        (cxx_init_decl_processing): Do not initialize error_mark_list.

        * g++.dg/expr/call3.C: New test.

Added:
    branches/gcc-4_0-branch/gcc/testsuite/g++.dg/expr/call3.C
Modified:
    branches/gcc-4_0-branch/gcc/cp/ChangeLog
    branches/gcc-4_0-branch/gcc/cp/cp-tree.h
    branches/gcc-4_0-branch/gcc/cp/decl.c
    branches/gcc-4_0-branch/gcc/cp/typeck.c
    branches/gcc-4_0-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/26036] [4.0/4.1/4.2 Regression] Treating a class object as a function with member variables causes hang
  2006-01-30 16:49 [Bug c++/26036] New: Treating a class object as a function with member variables causes hang ben at pc-doctor dot com
                   ` (9 preceding siblings ...)
  2006-04-19 17:43 ` reichelt at gcc dot gnu dot org
@ 2006-04-19 17:46 ` reichelt at gcc dot gnu dot org
  2006-04-19 17:50 ` patchapp at dberlin dot org
  11 siblings, 0 replies; 13+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-04-19 17:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from reichelt at gcc dot gnu dot org  2006-04-19 17:46 -------
Fixed on mainline, 4.1 branch, and 4.0 branch.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.1.1                       |4.0.4


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


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

* [Bug c++/26036] [4.0/4.1/4.2 Regression] Treating a class object as a function with member variables causes hang
  2006-01-30 16:49 [Bug c++/26036] New: Treating a class object as a function with member variables causes hang ben at pc-doctor dot com
                   ` (10 preceding siblings ...)
  2006-04-19 17:46 ` reichelt at gcc dot gnu dot org
@ 2006-04-19 17:50 ` patchapp at dberlin dot org
  11 siblings, 0 replies; 13+ messages in thread
From: patchapp at dberlin dot org @ 2006-04-19 17:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from patchapp at dberlin dot org  2006-04-19 17:50 -------
Subject: Bug number PR c++/26036

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-04/msg00711.html


-- 


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


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

end of thread, other threads:[~2006-04-19 17:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-30 16:49 [Bug c++/26036] New: Treating a class object as a function with member variables causes hang ben at pc-doctor dot com
2006-01-30 17:41 ` [Bug c++/26036] " ben at pc-doctor dot com
2006-01-30 18:07 ` [Bug c++/26036] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2006-01-31  2:44 ` mmitchel at gcc dot gnu dot org
2006-02-02  9:55 ` reichelt at gcc dot gnu dot org
2006-02-24  0:31 ` mmitchel at gcc dot gnu dot org
2006-04-19  9:34 ` reichelt at gcc dot gnu dot org
2006-04-19 16:57 ` mark at codesourcery dot com
2006-04-19 17:37 ` reichelt at gcc dot gnu dot org
2006-04-19 17:40 ` reichelt at gcc dot gnu dot org
2006-04-19 17:43 ` reichelt at gcc dot gnu dot org
2006-04-19 17:46 ` reichelt at gcc dot gnu dot org
2006-04-19 17:50 ` patchapp at dberlin 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).