public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/46394] New: [C++0X] no matching function with default template argument
@ 2010-11-09 14:41 marc.glisse at normalesup dot org
  2010-11-09 14:58 ` [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter paolo.carlini at oracle dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: marc.glisse at normalesup dot org @ 2010-11-09 14:41 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [C++0X] no matching function with default template
                    argument
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: marc.glisse@normalesup.org


This code recently stopped compiling. (I have a remove_cv on top of the
remove_reference in the original code but it didn't look necessary to reproduce
the problem)

#include <utility>
#include <tuple>
#include <type_traits>
struct A {
        template<class...U,class=
                typename std::enable_if<
                !std::is_same<
                std::tuple<typename std::remove_reference<U>::type...>,
                std::tuple<A>
                        >::value
                        >::type
                        >
                        A(U&&...u) ;
};
int main(){
        A a(1,2,3);
}


bug.cc: In function ‘int main()’:
bug.cc:16:11: error: no matching function for call to ‘A::A(int, int, int)’
bug.cc:13:13: note: candidates are: template<class ... U, class> A::A(U&& ...)
bug.cc:4:8: note:                 constexpr A::A(const A&)
bug.cc:4:8: note:                 constexpr A::A(A&&)


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

* [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter
  2010-11-09 14:41 [Bug c++/46394] New: [C++0X] no matching function with default template argument marc.glisse at normalesup dot org
@ 2010-11-09 14:58 ` paolo.carlini at oracle dot com
  2010-11-09 15:06 ` paolo.carlini at oracle dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-11-09 14:58 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.11.09 14:58:23
                 CC|                            |jason at gcc dot gnu.org
            Summary|[C++0X] no matching         |[C++0X] [4.6 Regression] no
                   |function with default       |matching function with
                   |template parameter          |default template parameter
     Ever Confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2010-11-09 14:58:23 UTC ---
Let's add Jason. I'm pretty sure this isn't a library issue because the same
happens with just:

template<class...U>
  struct tuple;

and outside std::tuple the rest is pretty trivial as far as the library is
concerned.


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

* [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter
  2010-11-09 14:41 [Bug c++/46394] New: [C++0X] no matching function with default template argument marc.glisse at normalesup dot org
  2010-11-09 14:58 ` [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter paolo.carlini at oracle dot com
@ 2010-11-09 15:06 ` paolo.carlini at oracle dot com
  2010-12-17 20:04 ` marc.glisse at normalesup dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-11-09 15:06 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0


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

* [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter
  2010-11-09 14:41 [Bug c++/46394] New: [C++0X] no matching function with default template argument marc.glisse at normalesup dot org
  2010-11-09 14:58 ` [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter paolo.carlini at oracle dot com
  2010-11-09 15:06 ` paolo.carlini at oracle dot com
@ 2010-12-17 20:04 ` marc.glisse at normalesup dot org
  2010-12-17 20:10 ` hjl.tools at gmail dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marc.glisse at normalesup dot org @ 2010-12-17 20:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marc Glisse <marc.glisse at normalesup dot org> 2010-12-17 20:04:18 UTC ---
Note that if I change the function to:

        template<class...U,class=
                typename std::enable_if<
                !std::is_same<
                std::tuple<U&&...>,
                void
                        >::value
                        >::type
                        >
                        A(U&&...u) ;

I get:

sorry, unimplemented: use of 'type_pack_expansion' in template


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

* [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter
  2010-11-09 14:41 [Bug c++/46394] New: [C++0X] no matching function with default template argument marc.glisse at normalesup dot org
                   ` (2 preceding siblings ...)
  2010-12-17 20:04 ` marc.glisse at normalesup dot org
@ 2010-12-17 20:10 ` hjl.tools at gmail dot com
  2011-01-03 20:20 ` dodji at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2010-12-17 20:10 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dseketel at redhat dot com

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2010-12-17 20:10:12 UTC ---
It is caused by revision 166179:

http://gcc.gnu.org/ml/gcc-cvs/2010-11/msg00065.html


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

* [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter
  2010-11-09 14:41 [Bug c++/46394] New: [C++0X] no matching function with default template argument marc.glisse at normalesup dot org
                   ` (3 preceding siblings ...)
  2010-12-17 20:10 ` hjl.tools at gmail dot com
@ 2011-01-03 20:20 ` dodji at gcc dot gnu.org
  2011-01-04 15:33 ` dodji at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-01-03 20:20 UTC (permalink / raw)
  To: gcc-bugs

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

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|dseketel at redhat dot com  |dodji at gcc dot gnu.org
         AssignedTo|unassigned at gcc dot       |dodji at gcc dot gnu.org
                   |gnu.org                     |


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

* [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter
  2010-11-09 14:41 [Bug c++/46394] New: [C++0X] no matching function with default template argument marc.glisse at normalesup dot org
                   ` (4 preceding siblings ...)
  2011-01-03 20:20 ` dodji at gcc dot gnu.org
@ 2011-01-04 15:33 ` dodji at gcc dot gnu.org
  2011-02-04 19:53 ` dodji at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-01-04 15:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-01-04 15:32:53 UTC ---
I think what's happening is, at some point during template parameters
fixup (to build proper canonical types for dependent parms) we try to
substitute the U template parameter pack [and the the remaining unamed
template parm] into the pattern of the default argument
std::remote_reference<U>::type... . The TYPENAME_TYPE case of tsubst then
logically calls tsubst_aggr_type on 'std::remote_reference<U>'. That
later function in turn calls lookup_template_class with
std::remote_reference as argument to D1 and a TYPE_PACK_EXPANSION
built for the template parameter U (by template_parm_to_arg) and
argument to ARGLIST.

At that point we are trying to match a template argument which is
a pack expansion with a template parameter that is not a
parameter pack - and we hit
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35722.

So I think I am going to focus on that bug and see.


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

* [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter
  2010-11-09 14:41 [Bug c++/46394] New: [C++0X] no matching function with default template argument marc.glisse at normalesup dot org
                   ` (5 preceding siblings ...)
  2011-01-04 15:33 ` dodji at gcc dot gnu.org
@ 2011-02-04 19:53 ` dodji at gcc dot gnu.org
  2011-02-08 13:45 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-02-04 19:53 UTC (permalink / raw)
  To: gcc-bugs

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

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|35722                       |

--- Comment #5 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-02-04 19:53:24 UTC ---
Actually my previous analysis wasn't quite right. Rather, the
substitution of the fixed up U into std::remove_reference<U>::type...,
fails. It fails because we fail to compare the fixed up U with the
non-fixed up U. And after that the sky falls.

So this has nothing to do with
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35722, luckily. Pheew.

A candidate patch was sent to to
http://gcc.gnu.org/ml/gcc-patches/2011-02/msg00295.html along with a
smaller reproducer.


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

* [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter
  2010-11-09 14:41 [Bug c++/46394] New: [C++0X] no matching function with default template argument marc.glisse at normalesup dot org
                   ` (6 preceding siblings ...)
  2011-02-04 19:53 ` dodji at gcc dot gnu.org
@ 2011-02-08 13:45 ` rguenth at gcc dot gnu.org
  2011-02-20 17:42 ` dodji at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-02-08 13:45 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
           Priority|P3                          |P1


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

* [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter
  2010-11-09 14:41 [Bug c++/46394] New: [C++0X] no matching function with default template argument marc.glisse at normalesup dot org
                   ` (7 preceding siblings ...)
  2011-02-08 13:45 ` rguenth at gcc dot gnu.org
@ 2011-02-20 17:42 ` dodji at gcc dot gnu.org
  2011-02-20 18:09 ` dodji at gcc dot gnu.org
  2011-02-20 18:10 ` dodji at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-02-20 17:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-02-20 17:37:06 UTC ---
Author: dodji
Date: Sun Feb 20 17:37:03 2011
New Revision: 170341

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170341
Log:
PR c++/46394

gcc/cp/

    PR c++/46394
    * pt.c (tsubst_pack_expansion): do not use
    cp_tree_equal/same_type_p to detect an expansion of a parameter
    pack.

gcc/testsuite/

    PR c++/46394
    * g++.dg/template/typedef38.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/template/typedef38.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter
  2010-11-09 14:41 [Bug c++/46394] New: [C++0X] no matching function with default template argument marc.glisse at normalesup dot org
                   ` (8 preceding siblings ...)
  2011-02-20 17:42 ` dodji at gcc dot gnu.org
@ 2011-02-20 18:09 ` dodji at gcc dot gnu.org
  2011-02-20 18:10 ` dodji at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-02-20 18:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-02-20 18:08:14 UTC ---
Fixed in trunk (4.6).


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

* [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter
  2010-11-09 14:41 [Bug c++/46394] New: [C++0X] no matching function with default template argument marc.glisse at normalesup dot org
                   ` (9 preceding siblings ...)
  2011-02-20 18:09 ` dodji at gcc dot gnu.org
@ 2011-02-20 18:10 ` dodji at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-02-20 18:10 UTC (permalink / raw)
  To: gcc-bugs

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

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

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

--- Comment #8 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-02-20 18:09:04 UTC ---
Really close the bug.


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

end of thread, other threads:[~2011-02-20 18:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-09 14:41 [Bug c++/46394] New: [C++0X] no matching function with default template argument marc.glisse at normalesup dot org
2010-11-09 14:58 ` [Bug c++/46394] [C++0X] [4.6 Regression] no matching function with default template parameter paolo.carlini at oracle dot com
2010-11-09 15:06 ` paolo.carlini at oracle dot com
2010-12-17 20:04 ` marc.glisse at normalesup dot org
2010-12-17 20:10 ` hjl.tools at gmail dot com
2011-01-03 20:20 ` dodji at gcc dot gnu.org
2011-01-04 15:33 ` dodji at gcc dot gnu.org
2011-02-04 19:53 ` dodji at gcc dot gnu.org
2011-02-08 13:45 ` rguenth at gcc dot gnu.org
2011-02-20 17:42 ` dodji at gcc dot gnu.org
2011-02-20 18:09 ` dodji at gcc dot gnu.org
2011-02-20 18:10 ` dodji at gcc dot gnu.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).