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

--- Comment #3 from Mateusz Pusz <mateusz.pusz at gmail dot com> ---
(In reply to Marek Polacek from comment #1)
> This compiles if I use {} instead of ():
> 
> struct gram : unit<ratio(std::milli{})> {};

(In reply to Marek Polacek from comment #2)
> I think this is invalid.  [temp.arg]p2:
> "In a template-argument, an ambiguity between a type-id and an expression is
> resolved to a type-id, regardless of the form of the corresponding
> template-parameter."
> 
> template<auto>
> struct S { };
> 
> struct R { };
> 
> void
> g (void)
> {
>   S<R()> s; // template argument treated as function type
>   S<R{}> s2;
>   S<int()> s3; // template argument treated as function type
>   S<int{}> s4;
> }

Please note that all of the following compiles fine and is not treated as a
function type (most vexing parse)

constexpr auto r1(ratio(std::milli()));
constexpr auto r2(ratio(std::milli()));
constexpr ratio r3(std::milli());

Reply via email to