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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The non-void return expression in the void bar function makes the example
ill-formed regardless of the other problem, so let's fix that first:

>>>>>>>>>>>>>>
template <unsigned length> struct A {
    char str [length];

    constexpr A(char const (&s) [length]) {
        for (unsigned i = 0; i < length; ++i)
            str[i] = s[i];
    }
};

template <A a> struct B {
    auto bar() const {
        return a.str;
    }
};

//template <typename T> void fu (T    const& t) // Compiles successfully
  template <A        a> void fu (B<a> const& t) // Does not compile
//template <unsigned l> void fu (B<A<l>> const& t) // Does not compile either
{
      t.bar();
}

void test() {
    B<":/"> m;
    fu(m);
}
>>>>>>>>>>>>>>>>>>

Reply via email to