public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67426] New: Ambiguous overload between different function templates, where one has non-deduced arg
@ 2015-09-01 18:10 barry.revzin at gmail dot com
  2021-08-02  3:14 ` [Bug c++/67426] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: barry.revzin at gmail dot com @ 2015-09-01 18:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67426

            Bug ID: 67426
           Summary: Ambiguous overload between different function
                    templates, where one has non-deduced arg
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

Consider this example (also in SO question
http://stackoverflow.com/q/32335523/2069064):

#include <utility>

template <int N>
using size_ = std::integral_constant<int, N>; 

// (1)
template <int From>
void f(size_<From>, size_<From+1> )
{ }

// (2)
template <int From, int To>
void f(size_<From>, size_<To> )
{ }

int main()
{
    f(size_<0>{}, size_<1>{});
}

gcc 5.2 declares this call ambiguous. Deduction from (1) to (2) succeeds
easily, should deduction from (2) to (1) not fail?


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

* [Bug c++/67426] Ambiguous overload between different function templates, where one has non-deduced arg
  2015-09-01 18:10 [Bug c++/67426] New: Ambiguous overload between different function templates, where one has non-deduced arg barry.revzin at gmail dot com
@ 2021-08-02  3:14 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-02  3:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67426

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
GCC, clang and ICC all reject this code.
MSVC accepts it.

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

end of thread, other threads:[~2021-08-02  3:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-01 18:10 [Bug c++/67426] New: Ambiguous overload between different function templates, where one has non-deduced arg barry.revzin at gmail dot com
2021-08-02  3:14 ` [Bug c++/67426] " pinskia 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).