public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/26206]  New: g++ allows params with default arguments to the left of those without
@ 2006-02-10  2:18 jjamison at cs dot berkeley dot edu
  2006-02-10  2:24 ` [Bug c++/26206] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: jjamison at cs dot berkeley dot edu @ 2006-02-10  2:18 UTC (permalink / raw)
  To: gcc-bugs

Compiling the following one line:

   void f(int i = 0, int j) {}

produces the following error, as appropriate:

[jjamison@manzanita]$ /usr/misc/pkg/gcc-4.0.2/bin/g++ -c default.cc
default.cc: In function `void f(int, int)':
default.cc:1: error: default argument missing for parameter 2 of `void f(int,
int)'
[jjamison@manzanita]$

However, compiling the following analogous code produces no errors, even though
it should:

   struct T {
      T(int i = 0, int j) {}
      void m(int i = 0, int j) {}
   };

[jjamison@manzanita]$ /usr/misc/pkg/gcc-4.0.2/bin/g++ -c default.cc
[jjamison@manzanita]$

This behavior is replicated in 4.0.1, 4.0.0, 3.4.4, and 3.4.3.

[jjamison@manzanita]$ /usr/misc/pkg/gcc-4.0.2/bin/g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0.2/configure --prefix=/usr/misc/pkg/gcc-4.0.2
--enable-shared --enable-threads=posix --with-system-zlib --with-gnu-as
--with-as=/usr/misc/pkg/binutils-2.16/bin/as --with-gnu-ld
--with-ld=/usr/misc/pkg/binutils-2.16/bin/ld --enable-__cxa_atexit
--enable-languages=c,c++
Thread model: posix
gcc version 4.0.2


-- 
           Summary: g++ allows params with default arguments to the left of
                    those without
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jjamison at cs dot berkeley dot edu
 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=26206


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

* [Bug c++/26206] g++ allows params with default arguments to the left of those without
  2006-02-10  2:18 [Bug c++/26206] New: g++ allows params with default arguments to the left of those without jjamison at cs dot berkeley dot edu
@ 2006-02-10  2:24 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-10  2:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-02-10 02:24 -------
This is a dup  of bug 16829 which was fixed in 4.0.3.

*** This bug has been marked as a duplicate of 16829 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
           Keywords|                            |accepts-invalid
         Resolution|                            |DUPLICATE
   Target Milestone|---                         |4.0.3


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


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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-10  2:18 [Bug c++/26206] New: g++ allows params with default arguments to the left of those without jjamison at cs dot berkeley dot edu
2006-02-10  2:24 ` [Bug c++/26206] " pinskia 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).