public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56685] New: default template parameter cannot precede a non-default template parameter in a function
@ 2013-03-21 21:51 gessos.paul at yahoo dot gr
  2013-03-22 10:26 ` [Bug c++/56685] " paolo.carlini at oracle dot com
  0 siblings, 1 reply; 2+ messages in thread
From: gessos.paul at yahoo dot gr @ 2013-03-21 21:51 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56685
           Summary: default template parameter cannot precede a
                    non-default template parameter in a function
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gessos.paul@yahoo.gr


Following code is legal, according to spec, but not compile.

f(0) works fine

g(0) is the same thing, but not compile.

more discussion:
http://stackoverflow.com/questions/11684954/can-function-default-template-parameter-be-put-before-non-default-ones

-----------------------------------
#include <iostream>
#include <array>
#include <vector>

using namespace std;

struct X {};

template <class T = X, typename U>
void f(const U& m) {}

template <class T = X, typename U>
void g(const U& m) { auto ff = [] () {}; }

int main()
{
    f(0);
    g(0);
    return 0;
}


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

* [Bug c++/56685] default template parameter cannot precede a non-default template parameter in a function
  2013-03-21 21:51 [Bug c++/56685] New: default template parameter cannot precede a non-default template parameter in a function gessos.paul at yahoo dot gr
@ 2013-03-22 10:26 ` paolo.carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-03-22 10:26 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
      Known to work|                            |4.8.0, 4.9.0
         Resolution|                            |WORKSFORME

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-03-22 10:25:50 UTC ---
4.8.0 is fine and the issue isn't a regression.


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

end of thread, other threads:[~2013-03-22 10:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-21 21:51 [Bug c++/56685] New: default template parameter cannot precede a non-default template parameter in a function gessos.paul at yahoo dot gr
2013-03-22 10:26 ` [Bug c++/56685] " paolo.carlini at oracle dot com

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