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

            Bug ID: 117896
           Summary: Unexpected warning when specializing a template
           Product: gcc
           Version: 14.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: paul.batzing at gmail dot com
  Target Milestone: ---

Created attachment 59775
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59775&action=edit
reproducer code for template warning

see https://godbolt.org/z/hqoKe6bW3

Code to reproduce attached, built with flags -std=c++23 -O3 -flto

Produces unexpected warning 
/app/main.cpp:26:12: warning: partial specialization 'struct
detail::getter_impl<S<T, other_type>, V>' is not more specialized than
   26 |     struct getter_impl<S<T, other_type>, V> {
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/app/main.cpp:23:12: note: primary template 'template<class Q, typename
detail::ot_impl<decltype (Q{})>::type V> struct detail::getter_impl'
   23 |     struct getter_impl;
      |            ^~~~~~~~~~~

on gcc 14.2.1 and 15.0.0. Compiles without warning on clang 19.1.0.
  • [Bug c++/117896] New: Unexpecte... paul.batzing at gmail dot com via Gcc-bugs

Reply via email to