public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11540] New: Redefinition of default arguments allowed for template functions
@ 2003-07-16  8:13 philippe dot haution at mines-paris dot org
  2003-07-16 14:02 ` [Bug c++/11540] " bangerth at dealii dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: philippe dot haution at mines-paris dot org @ 2003-07-16  8:13 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=11540

           Summary: Redefinition of default arguments allowed for template
                    functions
           Product: gcc
           Version: 3.2.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: philippe dot haution at mines-paris dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

The following code is deemed legal by gcc, although it breaks the one definition
per translation unit rule :

testcase.cc :
-----------------------
namespace ns
{
  template<typename Tv>
  int convert_from_v(Tv v, int prec = -1)
  { return 1; }

}

namespace ns
{
  template<typename Tv>
  int convert_from_v(Tv v, int prec = -2);

}

int main()
{
  return ns::convert_from_v<int>(1);
}

$ g++ testcase.cc -o testcase
$ testcase
$ echo $?
255


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

end of thread, other threads:[~2004-07-13 20:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-16  8:13 [Bug c++/11540] New: Redefinition of default arguments allowed for template functions philippe dot haution at mines-paris dot org
2003-07-16 14:02 ` [Bug c++/11540] " bangerth at dealii dot org
2003-07-16 14:16 ` nathan at gcc dot gnu dot org
2003-07-16 14:39 ` bangerth at dealii dot org
2003-07-17  8:38 ` philippe dot haution at mines-paris dot org
2003-07-18 14:19 ` bangerth at dealii dot org
2003-08-06 14:35 ` bangerth at dealii dot org
2003-08-06 14:36 ` bangerth at dealii dot org
2003-08-06 14:40 ` jakub at gcc dot gnu dot org
2003-08-23  2:05 ` dhazeghi at yahoo dot com
2004-07-13 19:42 ` jens dot maurer at gmx dot net
2004-07-13 20:13 ` giovannibajo at libero dot it

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).