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

            Bug ID: 87108
           Summary: Template partial specialization is ignored
           Product: gcc
           Version: 8.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ghabriel.nunes at hotmail dot com
  Target Milestone: ---

Created attachment 44599
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44599&action=edit
Code to reproduce the problem

Compiling the attached code with g++ bug.cpp (no other flags required) results
in two errors:

bug.cpp: In function ‘ExampleScaling foo()’:
bug.cpp:26:17: error: could not convert ‘{42}’ from ‘<brace-enclosed
initializer list>’ to ‘ExampleScaling’ {aka ‘HowAboutNo’}
     return { 42 };
                 ^
bug.cpp: In function ‘int main(int, char**)’:
bug.cpp:30:24: error: ‘using ExampleScaling = scale_t<1000, amount<1> >’ {aka
‘struct HowAboutNo’} has no member named ‘value’
     std::cout << foo().value << std::endl;
                        ^~~~~

I've tested all versions from 6.1 to 8.2 (in godbolt) and 8.1.1 (locally) and
all of them yield the same result. The code compiles fine in Clang and MSVC.

Reply via email to