public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17268] New: GCC and template parameter deduction from function call
@ 2004-09-01 20:02 v dot haisman at sh dot cvut dot cz
  2004-09-02 15:09 ` [Bug c++/17268] " lerdsuwa at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: v dot haisman at sh dot cvut dot cz @ 2004-09-01 20:02 UTC (permalink / raw)
  To: gcc-bugs

GCC accepts following test case but I think it should not. I am not sure about
this but I think that the deduction of foo()'s type should fail as the function
template specifies that _Cont has only one template paramter and the supplied S
template has two and iirc default template paramters don't come to play when it
comes to deduction. Comeau also rejects it, though not with any helpful message
that could support my opinion.

template <typename T>
struct A
{ };

template <typename T, template <typename> class Alloc = A>
struct S
{ };

template <typename T, template <typename> class _Cont>
void foo (_Cont<T>)
{ }

int main ()
{
  foo (S<char> ());
}


WilX@amber2:::~/tmp> g++-3.5 -v
Reading specs from /usr/local/lib/gcc/i686-pc-cygwin/3.5.0/specs
Configured with: ../srcdir/configure --with-gcc --with-gnu-ld --with-gnu-as --en
able-languages=c,c++,objc --enable-threads=posix --with-system-zlib --enable-nls
 --without-included-gettext --enable-sjlj-exceptions --enable-version-specific-r
untime-libs --enable-shared --disable-win32-registry --enable-dwarf2 --with-cpu=
athlon-tbird --with-arch=athlon-tbird --program-suffix=-3.5
Thread model: posix
gcc version 3.5.0 20040826 (experimental)

-- 
           Summary: GCC and template parameter deduction from function call
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: v dot haisman at sh dot cvut dot cz
                CC: gcc-bugs at gcc dot gnu dot org,v dot haisman at sh dot
                    cvut dot cz
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin


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


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

* [Bug c++/17268] GCC and template parameter deduction from function call
  2004-09-01 20:02 [Bug c++/17268] New: GCC and template parameter deduction from function call v dot haisman at sh dot cvut dot cz
@ 2004-09-02 15:09 ` lerdsuwa at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2004-09-02 15:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From lerdsuwa at gcc dot gnu dot org  2004-09-02 15:09 -------
This is a duplicate of bug 9737.  You can find extensive discussions there.

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

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2004-09-02 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-01 20:02 [Bug c++/17268] New: GCC and template parameter deduction from function call v dot haisman at sh dot cvut dot cz
2004-09-02 15:09 ` [Bug c++/17268] " lerdsuwa 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).