public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12323] New: Constructor accepts wrong argument type silently
@ 2003-09-18  1:39 igodard at pacbell dot net
  2003-09-18  2:25 ` [Bug c++/12323] " igodard at pacbell dot net
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: igodard at pacbell dot net @ 2003-09-18  1:39 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Constructor accepts wrong argument type silently
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net
                CC: gcc-bugs at gcc dot gnu dot org

A constructor looking for Foo(int, Bar<Baz>) also accepts Foo(int, Baz) without error.


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

* [Bug c++/12323] Constructor accepts wrong argument type silently
  2003-09-18  1:39 [Bug c++/12323] New: Constructor accepts wrong argument type silently igodard at pacbell dot net
@ 2003-09-18  2:25 ` igodard at pacbell dot net
  2003-09-18  2:38 ` igodard at pacbell dot net
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: igodard at pacbell dot net @ 2003-09-18  2:25 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From igodard at pacbell dot net  2003-09-18 01:20 -------
Created an attachment (id=4780)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4780&action=view)
Compiler output (-v -save-temps)


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

* [Bug c++/12323] Constructor accepts wrong argument type silently
  2003-09-18  1:39 [Bug c++/12323] New: Constructor accepts wrong argument type silently igodard at pacbell dot net
  2003-09-18  2:25 ` [Bug c++/12323] " igodard at pacbell dot net
@ 2003-09-18  2:38 ` igodard at pacbell dot net
  2003-09-18  3:32 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: igodard at pacbell dot net @ 2003-09-18  2:38 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From igodard at pacbell dot net  2003-09-18 01:21 -------
Created an attachment (id=4781)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4781&action=view)
Source code (-save-temps)


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

* [Bug c++/12323] Constructor accepts wrong argument type silently
  2003-09-18  1:39 [Bug c++/12323] New: Constructor accepts wrong argument type silently igodard at pacbell dot net
  2003-09-18  2:25 ` [Bug c++/12323] " igodard at pacbell dot net
  2003-09-18  2:38 ` igodard at pacbell dot net
@ 2003-09-18  3:32 ` pinskia at gcc dot gnu dot org
  2003-09-18  6:16 ` igodard at pacbell dot net
  2003-09-18  6:56 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-18  3:32 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-09-18 01:31 -------
I get an error with every version of GCC I tried from 2.95.3 to the mainline:
foo.cc: In function `int main()':
foo.cc:25: error: no matching function for call to `Foo<int, Bar<Baz> >::Foo(int, Bob)'
foo.cc:2: note: candidates are: Foo<int, Bar<Baz> >::Foo(const Foo<int, Bar<Baz> >&)
foo.cc:4: note:                 Foo<I, P>::Foo(I, P) [with I = int, P = Bar<Baz>]

What was you expecting?


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

* [Bug c++/12323] Constructor accepts wrong argument type silently
  2003-09-18  1:39 [Bug c++/12323] New: Constructor accepts wrong argument type silently igodard at pacbell dot net
                   ` (2 preceding siblings ...)
  2003-09-18  3:32 ` pinskia at gcc dot gnu dot org
@ 2003-09-18  6:16 ` igodard at pacbell dot net
  2003-09-18  6:56 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: igodard at pacbell dot net @ 2003-09-18  6:16 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From igodard at pacbell dot net  2003-09-18 05:20 -------
I also (correctly) get an error on Bob; that's not the reported bug. The bug is that I do *not* get an arror on Baz. I put the Bob in only to show that the compiler correctly flags args *except* the nested template arg type. Remove the line where the compiler reports the error on the test case, and you get a clean compile - and should not.


Ivan


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

* [Bug c++/12323] Constructor accepts wrong argument type silently
  2003-09-18  1:39 [Bug c++/12323] New: Constructor accepts wrong argument type silently igodard at pacbell dot net
                   ` (3 preceding siblings ...)
  2003-09-18  6:16 ` igodard at pacbell dot net
@ 2003-09-18  6:56 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-18  6:56 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-09-18 06:16 -------
GCC Accepts it as Bar<Baz>'s constructor accepts Baz so the conversion between Baz and 
Bar<Baz> is done and calls Bar<Baz>::Bar(Baz).


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

end of thread, other threads:[~2003-09-18  6:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-18  1:39 [Bug c++/12323] New: Constructor accepts wrong argument type silently igodard at pacbell dot net
2003-09-18  2:25 ` [Bug c++/12323] " igodard at pacbell dot net
2003-09-18  2:38 ` igodard at pacbell dot net
2003-09-18  3:32 ` pinskia at gcc dot gnu dot org
2003-09-18  6:16 ` igodard at pacbell dot net
2003-09-18  6:56 ` 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).