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

            Bug ID: 92327
           Summary: insufficient diagnosis on the incompatibility  type of
                    auto template parameter
           Product: gcc
           Version: 9.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jonathan.poelen at gmail dot com
  Target Milestone: ---

template<auto> class val{};
long const x = 1;
val<1> v = val<x>(); // val<1> != val<1>

test.cpp:3:12: error: conversion from ‘val<1>’ to non-scalar type ‘val<1>’
requested
    3 | val<1> v = val<x>();
      |            ^~~~~~~~

https://godbolt.org/z/l_nb-W

Clang shows the real type of the parameter:

test.cpp:3:8: error: no viable conversion from 'val<x aka (long) 1>' to
'val<(int) 1>'

Reply via email to