public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16829] default parameter can be not one of the last  in template function
       [not found] <bug-16829-3386@http.gcc.gnu.org/bugzilla/>
@ 2005-12-17 19:55 ` reichelt at gcc dot gnu dot org
  2006-01-19  9:52 ` reichelt at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-12-17 19:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from reichelt at gcc dot gnu dot org  2005-12-17 19:55 -------
Working on a patch.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |reichelt at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/16829] default parameter can be not one of the last  in template function
       [not found] <bug-16829-3386@http.gcc.gnu.org/bugzilla/>
  2005-12-17 19:55 ` [Bug c++/16829] default parameter can be not one of the last in template function reichelt at gcc dot gnu dot org
@ 2006-01-19  9:52 ` reichelt at gcc dot gnu dot org
  2006-01-19  9:56 ` reichelt at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-01-19  9:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from reichelt at gcc dot gnu dot org  2006-01-19 09:52 -------
Subject: Bug 16829

Author: reichelt
Date: Thu Jan 19 09:51:57 2006
New Revision: 109950

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109950
Log:
        PR c++/16829
        * decl.c (start_preparsed_function): Check default arguments
        unconditionally.
        * name-lookup.c (pushdecl_maybe_friend): Check default arguments
        of all functions and function templates.
        * parser.c (cp_parser_late_parsing_default_args): Check default
        arguments.
        * decl2.c (check_default_args): Set missing default arguments to
        error_mark_node.

        * g++.dg/other/default2.C: New test.
        * g++.dg/other/default3.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/other/default2.C
    trunk/gcc/testsuite/g++.dg/other/default3.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/decl2.c
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/16829] default parameter can be not one of the last  in template function
       [not found] <bug-16829-3386@http.gcc.gnu.org/bugzilla/>
  2005-12-17 19:55 ` [Bug c++/16829] default parameter can be not one of the last in template function reichelt at gcc dot gnu dot org
  2006-01-19  9:52 ` reichelt at gcc dot gnu dot org
@ 2006-01-19  9:56 ` reichelt at gcc dot gnu dot org
  2006-01-19 10:01 ` reichelt at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-01-19  9:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from reichelt at gcc dot gnu dot org  2006-01-19 09:56 -------
Subject: Bug 16829

Author: reichelt
Date: Thu Jan 19 09:56:44 2006
New Revision: 109952

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109952
Log:
        PR c++/16829
        * decl.c (start_preparsed_function): Check default arguments
        unconditionally.
        * name-lookup.c (pushdecl_maybe_friend): Check default arguments
        of all functions and function templates.
        * parser.c (cp_parser_late_parsing_default_args): Check default
        arguments.
        * decl2.c (check_default_args): Set missing default arguments to
        error_mark_node.

        * g++.dg/other/default2.C: New test.
        * g++.dg/other/default3.C: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/other/default2.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/other/default3.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/decl.c
    branches/gcc-4_1-branch/gcc/cp/decl2.c
    branches/gcc-4_1-branch/gcc/cp/name-lookup.c
    branches/gcc-4_1-branch/gcc/cp/parser.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/16829] default parameter can be not one of the last  in template function
       [not found] <bug-16829-3386@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2006-01-19  9:56 ` reichelt at gcc dot gnu dot org
@ 2006-01-19 10:01 ` reichelt at gcc dot gnu dot org
  2006-01-19 10:06 ` [Bug c++/16829] [3.4 regression] default parameter can be not one of the last in function reichelt at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-01-19 10:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from reichelt at gcc dot gnu dot org  2006-01-19 10:01 -------
Subject: Bug 16829

Author: reichelt
Date: Thu Jan 19 10:01:20 2006
New Revision: 109953

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109953
Log:
        PR c++/16829
        * decl.c (start_preparsed_function): Check default arguments
        unconditionally.
        * name-lookup.c (pushdecl_maybe_friend): Check default arguments
        of all functions and function templates.
        * parser.c (cp_parser_late_parsing_default_args): Check default
        arguments.
        * decl2.c (check_default_args): Set missing default arguments to
        error_mark_node.

        * g++.dg/other/default2.C: New test.
        * g++.dg/other/default3.C: New test.

Added:
    branches/gcc-4_0-branch/gcc/testsuite/g++.dg/other/default2.C
    branches/gcc-4_0-branch/gcc/testsuite/g++.dg/other/default3.C
Modified:
    branches/gcc-4_0-branch/gcc/cp/ChangeLog
    branches/gcc-4_0-branch/gcc/cp/decl.c
    branches/gcc-4_0-branch/gcc/cp/decl2.c
    branches/gcc-4_0-branch/gcc/cp/name-lookup.c
    branches/gcc-4_0-branch/gcc/cp/parser.c
    branches/gcc-4_0-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/16829] [3.4 regression] default parameter can be not one of the last in function
       [not found] <bug-16829-3386@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2006-01-19 10:01 ` reichelt at gcc dot gnu dot org
@ 2006-01-19 10:06 ` reichelt at gcc dot gnu dot org
  2006-01-24 11:38 ` reichelt at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-01-19 10:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from reichelt at gcc dot gnu dot org  2006-01-19 10:06 -------
This is fixed now in gcc 4.0.3.
I'll wait a couple of days until I'll apply the patch to the 3.4 branch, too.

Btw, the following testcase is a regression from 3.3.x:

================================
struct A
{
    void foo(int = 0, int);
};
================================


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   GCC host triplet|i386-pc-linux-gnu/3.3.3     |
           Keywords|                            |ice-on-invalid-code
            Summary|default parameter can be not|[3.4 regression] default
                   |one of the last  in template|parameter can be not one of
                   |function                    |the last in function
   Target Milestone|---                         |3.4.6


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


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

* [Bug c++/16829] [3.4 regression] default parameter can be not one of the last in function
       [not found] <bug-16829-3386@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2006-01-19 10:06 ` [Bug c++/16829] [3.4 regression] default parameter can be not one of the last in function reichelt at gcc dot gnu dot org
@ 2006-01-24 11:38 ` reichelt at gcc dot gnu dot org
  2006-01-24 11:40 ` reichelt at gcc dot gnu dot org
  2006-02-10  2:24 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-01-24 11:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from reichelt at gcc dot gnu dot org  2006-01-24 11:38 -------
Subject: Bug 16829

Author: reichelt
Date: Tue Jan 24 11:38:06 2006
New Revision: 110167

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110167
Log:
        PR c++/16829
        * decl.c (start_preparsed_function): Check default arguments
        unconditionally.
        * name-lookup.c (pushdecl_maybe_friend): Check default arguments
        of all functions and function templates.
        * parser.c (cp_parser_late_parsing_default_args): Check default
        arguments.
        * decl2.c (check_default_args): Set missing default arguments to
        error_mark_node.

        * g++.dg/other/default2.C: New test.
        * g++.dg/other/default3.C: New test.

Added:
    branches/gcc-3_4-branch/gcc/testsuite/g++.dg/other/default2.C
    branches/gcc-3_4-branch/gcc/testsuite/g++.dg/other/default3.C
Modified:
    branches/gcc-3_4-branch/gcc/cp/ChangeLog
    branches/gcc-3_4-branch/gcc/cp/decl.c
    branches/gcc-3_4-branch/gcc/cp/decl2.c
    branches/gcc-3_4-branch/gcc/cp/name-lookup.c
    branches/gcc-3_4-branch/gcc/cp/parser.c
    branches/gcc-3_4-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/16829] [3.4 regression] default parameter can be not one of the last in function
       [not found] <bug-16829-3386@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2006-01-24 11:38 ` reichelt at gcc dot gnu dot org
@ 2006-01-24 11:40 ` reichelt at gcc dot gnu dot org
  2006-02-10  2:24 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-01-24 11:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from reichelt at gcc dot gnu dot org  2006-01-24 11:40 -------
Now also fixed on the 3.4 branch.


-- 

reichelt at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/16829] [3.4 regression] default parameter can be not one of the last in function
       [not found] <bug-16829-3386@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2006-01-24 11:40 ` reichelt at gcc dot gnu dot org
@ 2006-02-10  2:24 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-10  2:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from pinskia at gcc dot gnu dot org  2006-02-10 02:24 -------
*** Bug 26206 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jjamison at cs dot berkeley
                   |                            |dot edu


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


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

* [Bug c++/16829] default parameter can be not one of the last  in template function
  2004-07-30  3:51 [Bug c++/16829] New: default parameter can be not one of the last in template function charles at kde dot org
                   ` (5 preceding siblings ...)
  2005-05-09 14:25 ` pinskia at gcc dot gnu dot org
@ 2005-07-06  1:26 ` charles at kde dot org
  6 siblings, 0 replies; 15+ messages in thread
From: charles at kde dot org @ 2005-07-06  1:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From charles at kde dot org  2005-07-06 01:26 -------
I should point out that fixing the actual bug in question will fix the ICE 
itself. 

-- 


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


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

* [Bug c++/16829] default parameter can be not one of the last  in template function
  2004-07-30  3:51 [Bug c++/16829] New: default parameter can be not one of the last in template function charles at kde dot org
                   ` (4 preceding siblings ...)
  2005-01-25 17:05 ` Matthieu dot Moy at imag dot fr
@ 2005-05-09 14:25 ` pinskia at gcc dot gnu dot org
  2005-07-06  1:26 ` charles at kde dot org
  6 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-09 14:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-09 14:22 -------
*** Bug 21467 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sylvain dot joyeux at m4x
                   |                            |dot org


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


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

* [Bug c++/16829] default parameter can be not one of the last  in template function
  2004-07-30  3:51 [Bug c++/16829] New: default parameter can be not one of the last in template function charles at kde dot org
                   ` (3 preceding siblings ...)
  2005-01-25 16:32 ` pinskia at gcc dot gnu dot org
@ 2005-01-25 17:05 ` Matthieu dot Moy at imag dot fr
  2005-05-09 14:25 ` pinskia at gcc dot gnu dot org
  2005-07-06  1:26 ` charles at kde dot org
  6 siblings, 0 replies; 15+ messages in thread
From: Matthieu dot Moy at imag dot fr @ 2005-01-25 17:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Matthieu dot Moy at imag dot fr  2005-01-25 17:05 -------
Bug 19625 contains two other similar testcases. They're worth trying once the
bug is fixed.

-- 


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


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

* [Bug c++/16829] default parameter can be not one of the last  in template function
  2004-07-30  3:51 [Bug c++/16829] New: default parameter can be not one of the last in template function charles at kde dot org
                   ` (2 preceding siblings ...)
  2004-07-30 13:20 ` bangerth at dealii dot org
@ 2005-01-25 16:32 ` pinskia at gcc dot gnu dot org
  2005-01-25 17:05 ` Matthieu dot Moy at imag dot fr
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-25 16:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-25 16:31 -------
*** Bug 19625 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Matthieu dot Moy at imag dot
                   |                            |fr


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


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

* [Bug c++/16829] default parameter can be not one of the last  in template function
  2004-07-30  3:51 [Bug c++/16829] New: default parameter can be not one of the last in template function charles at kde dot org
  2004-07-30  4:04 ` [Bug c++/16829] " charles at kde dot org
  2004-07-30  4:15 ` pinskia at gcc dot gnu dot org
@ 2004-07-30 13:20 ` bangerth at dealii dot org
  2005-01-25 16:32 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: bangerth at dealii dot org @ 2004-07-30 13:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-07-30 13:20 -------
Just for completeness: this is the ICE on the second snippet: 
 
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc 
x.cc: In function `int main()': 
x.cc:6: internal compiler error: Segmentation fault 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
W. 

-- 


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


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

* [Bug c++/16829] default parameter can be not one of the last  in template function
  2004-07-30  3:51 [Bug c++/16829] New: default parameter can be not one of the last in template function charles at kde dot org
  2004-07-30  4:04 ` [Bug c++/16829] " charles at kde dot org
@ 2004-07-30  4:15 ` pinskia at gcc dot gnu dot org
  2004-07-30 13:20 ` bangerth at dealii dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-30  4:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-30 04:15 -------
Confirmed
: Test is the same (pass) at both endpoints (2000-12-31-trunk,
: 2004-07-28-trunk), so there's nothing for me to do.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |accepts-invalid
   Last reconfirmed|0000-00-00 00:00:00         |2004-07-30 04:15:22
               date|                            |


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


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

* [Bug c++/16829] default parameter can be not one of the last  in template function
  2004-07-30  3:51 [Bug c++/16829] New: default parameter can be not one of the last in template function charles at kde dot org
@ 2004-07-30  4:04 ` charles at kde dot org
  2004-07-30  4:15 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: charles at kde dot org @ 2004-07-30  4:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From charles at kde dot org  2004-07-30 04:04 -------
And now I have the ICE (which may be rather unrelated): 
 
template <class A> void foo(A a, int c=0, int d) 
{ } 
 
int main() 
{ 
	foo(0); 
} 
 
To reproduce this, create a template function in which a parameter has a 
default value, but it has a parameter after it without a default value.  Then 
try to call that template function where the number of parameters passed is 
the number of parameters that have no default, up to the one that does have a 
default. (whew!) 
 
reproduced on: 
 gcc version 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6) 
 

-- 


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


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

end of thread, other threads:[~2006-02-10  2:24 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-16829-3386@http.gcc.gnu.org/bugzilla/>
2005-12-17 19:55 ` [Bug c++/16829] default parameter can be not one of the last in template function reichelt at gcc dot gnu dot org
2006-01-19  9:52 ` reichelt at gcc dot gnu dot org
2006-01-19  9:56 ` reichelt at gcc dot gnu dot org
2006-01-19 10:01 ` reichelt at gcc dot gnu dot org
2006-01-19 10:06 ` [Bug c++/16829] [3.4 regression] default parameter can be not one of the last in function reichelt at gcc dot gnu dot org
2006-01-24 11:38 ` reichelt at gcc dot gnu dot org
2006-01-24 11:40 ` reichelt at gcc dot gnu dot org
2006-02-10  2:24 ` pinskia at gcc dot gnu dot org
2004-07-30  3:51 [Bug c++/16829] New: default parameter can be not one of the last in template function charles at kde dot org
2004-07-30  4:04 ` [Bug c++/16829] " charles at kde dot org
2004-07-30  4:15 ` pinskia at gcc dot gnu dot org
2004-07-30 13:20 ` bangerth at dealii dot org
2005-01-25 16:32 ` pinskia at gcc dot gnu dot org
2005-01-25 17:05 ` Matthieu dot Moy at imag dot fr
2005-05-09 14:25 ` pinskia at gcc dot gnu dot org
2005-07-06  1:26 ` charles at kde 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).