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

            Bug ID: 103684
           Summary: Ambiguous template template overload resolution
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: weidmann at acm dot org
  Target Milestone: ---

The following code compiles with -std=c++11, but does not with -std=c++17.
Works with clang.

#include <list>
#include <set>

template<template<typename, typename> typename T> constexpr std::size_t hello()
{
    return 2;
}

template<template<typename, typename, typename> typename T> constexpr
std::size_t hello()
{
    return 3;
}

void foo()
{
    auto i = hello<std::list>();
    auto j = hello<std::set>();
}

Reply via email to