public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55724] New: Default type of a template value is not working
@ 2012-12-17 19:08 vince.rev at gmail dot com
  2012-12-17 19:14 ` [Bug c++/55724] [C++11] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: vince.rev at gmail dot com @ 2012-12-17 19:08 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55724
           Summary: Default type of a template value is not working
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vince.rev@gmail.com


The following code does not compile with g++ 4.7 :

--------------------------------------------
template<int N> struct S {};
template<typename T = int, T N> void f(S<N>) {}
int main() { S<1> s; f(s); }
--------------------------------------------

(source : http://stackoverflow.com/q/13915835/882932)


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

* [Bug c++/55724] [C++11] Default type of a template value is not working
  2012-12-17 19:08 [Bug c++/55724] New: Default type of a template value is not working vince.rev at gmail dot com
@ 2012-12-17 19:14 ` pinskia at gcc dot gnu.org
  2012-12-17 19:26 ` ed at catmur dot co.uk
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-12-17 19:14 UTC (permalink / raw)
  To: gcc-bugs


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Default type of a template  |[C++11] Default type of a
                   |value is not working        |template value is not
                   |                            |working
           Severity|blocker                     |normal


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

* [Bug c++/55724] [C++11] Default type of a template value is not working
  2012-12-17 19:08 [Bug c++/55724] New: Default type of a template value is not working vince.rev at gmail dot com
  2012-12-17 19:14 ` [Bug c++/55724] [C++11] " pinskia at gcc dot gnu.org
@ 2012-12-17 19:26 ` ed at catmur dot co.uk
  2012-12-17 19:47 ` [Bug c++/55724] [4.7/4.8 Regression] " redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ed at catmur dot co.uk @ 2012-12-17 19:26 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Ed Catmur <ed at catmur dot co.uk> 2012-12-17 19:25:39 UTC ---
It's not entirely clear in the standard, but my understanding of 14.8.2p5 is
that default template argument substitution is contemporaneous to template
argument deduction for any particular parameter.  Non-type template parameter
types deduced from preceding arguments *are* accepted by gcc:

template<int N> struct S {};
template<typename T, T N> void g(T, S<N>) {}
int main() { S<1> s; g(2, s); }


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

* [Bug c++/55724] [4.7/4.8 Regression] [C++11] Default type of a template value is not working
  2012-12-17 19:08 [Bug c++/55724] New: Default type of a template value is not working vince.rev at gmail dot com
  2012-12-17 19:14 ` [Bug c++/55724] [C++11] " pinskia at gcc dot gnu.org
  2012-12-17 19:26 ` ed at catmur dot co.uk
@ 2012-12-17 19:47 ` redi at gcc dot gnu.org
  2012-12-18 15:09 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2012-12-17 19:47 UTC (permalink / raw)
  To: gcc-bugs


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-12-17
      Known to work|                            |4.5.3, 4.6.3
            Summary|[C++11] Default type of a   |[4.7/4.8 Regression]
                   |template value is not       |[C++11] Default type of a
                   |working                     |template value is not
                   |                            |working
     Ever Confirmed|0                           |1
      Known to fail|                            |4.7.2, 4.8.0


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

* [Bug c++/55724] [4.7/4.8 Regression] [C++11] Default type of a template value is not working
  2012-12-17 19:08 [Bug c++/55724] New: Default type of a template value is not working vince.rev at gmail dot com
                   ` (2 preceding siblings ...)
  2012-12-17 19:47 ` [Bug c++/55724] [4.7/4.8 Regression] " redi at gcc dot gnu.org
@ 2012-12-18 15:09 ` rguenth at gcc dot gnu.org
  2012-12-18 17:53 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-18 15:09 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.3

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-18 15:08:44 UTC ---
trunk now says:

t.C: In function 'int main()':
t.C:3:25: error: no matching function for call to 'f(S<1>&)'
 int main() { S<1> s; f(s); }
                         ^
t.C:3:25: note: candidate is:
t.C:2:38: note: template<class T, T N> void f(S<N>)
 template<typename T = int, T N> void f(S<N>) {}
                                      ^
t.C:2:38: note:   template argument deduction/substitution failed:
t.C:3:25: note:   couldn't deduce template parameter 'N'
 int main() { S<1> s; f(s); }
                         ^


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

* [Bug c++/55724] [4.7/4.8 Regression] [C++11] Default type of a template value is not working
  2012-12-17 19:08 [Bug c++/55724] New: Default type of a template value is not working vince.rev at gmail dot com
                   ` (3 preceding siblings ...)
  2012-12-18 15:09 ` rguenth at gcc dot gnu.org
@ 2012-12-18 17:53 ` jason at gcc dot gnu.org
  2012-12-19 22:23 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2012-12-18 17:53 UTC (permalink / raw)
  To: gcc-bugs


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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |jason at gcc dot gnu.org
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |


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

* [Bug c++/55724] [4.7/4.8 Regression] [C++11] Default type of a template value is not working
  2012-12-17 19:08 [Bug c++/55724] New: Default type of a template value is not working vince.rev at gmail dot com
                   ` (4 preceding siblings ...)
  2012-12-18 17:53 ` jason at gcc dot gnu.org
@ 2012-12-19 22:23 ` jason at gcc dot gnu.org
  2012-12-20  2:58 ` jason at gcc dot gnu.org
  2012-12-20  3:00 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2012-12-19 22:23 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2012-12-19 22:22:42 UTC ---
Author: jason
Date: Wed Dec 19 22:22:36 2012
New Revision: 194620

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194620
Log:
    PR c++/55724
    * pt.c (type_unification_real): Re-combine post-deduction loops.

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


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

* [Bug c++/55724] [4.7/4.8 Regression] [C++11] Default type of a template value is not working
  2012-12-17 19:08 [Bug c++/55724] New: Default type of a template value is not working vince.rev at gmail dot com
                   ` (5 preceding siblings ...)
  2012-12-19 22:23 ` jason at gcc dot gnu.org
@ 2012-12-20  2:58 ` jason at gcc dot gnu.org
  2012-12-20  3:00 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2012-12-20  2:58 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2012-12-20 02:58:20 UTC ---
Author: jason
Date: Thu Dec 20 02:58:16 2012
New Revision: 194627

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194627
Log:
    PR c++/55724
    * pt.c (type_unification_real): Re-combine post-deduction loops.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg4.C
Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/pt.c


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

* [Bug c++/55724] [4.7/4.8 Regression] [C++11] Default type of a template value is not working
  2012-12-17 19:08 [Bug c++/55724] New: Default type of a template value is not working vince.rev at gmail dot com
                   ` (6 preceding siblings ...)
  2012-12-20  2:58 ` jason at gcc dot gnu.org
@ 2012-12-20  3:00 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2012-12-20  3:00 UTC (permalink / raw)
  To: gcc-bugs


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

Jason Merrill <jason at gcc dot gnu.org> changed:

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2012-12-20 02:59:55 UTC ---
Fixed.


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

end of thread, other threads:[~2012-12-20  3:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-17 19:08 [Bug c++/55724] New: Default type of a template value is not working vince.rev at gmail dot com
2012-12-17 19:14 ` [Bug c++/55724] [C++11] " pinskia at gcc dot gnu.org
2012-12-17 19:26 ` ed at catmur dot co.uk
2012-12-17 19:47 ` [Bug c++/55724] [4.7/4.8 Regression] " redi at gcc dot gnu.org
2012-12-18 15:09 ` rguenth at gcc dot gnu.org
2012-12-18 17:53 ` jason at gcc dot gnu.org
2012-12-19 22:23 ` jason at gcc dot gnu.org
2012-12-20  2:58 ` jason at gcc dot gnu.org
2012-12-20  3:00 ` jason 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).