[Bug c++/88820] ICE in in C++2a mode for code which is able to be compiled in C++17 mode

hanicka at hanicka dot net gcc-bugzilla@gcc.gnu.org
Sun Jan 13 17:51:00 GMT 2019


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

--- Comment #2 from Hana Dusíková <hanicka at hanicka dot net> ---
Created attachment 45422
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45422&action=edit
referencing subtype unable to deduce parent type

 ~/projekty/ice-gcc > g++-HEAD minimal.cpp -std=c++2a -DREFERENCE
 ~/projekty/ice-gcc > g++-HEAD minimal.cpp -std=c++2a -DAUTO     
 ~/projekty/ice-gcc > g++-HEAD minimal.cpp -std=c++2a -DCNTTP    
minimal.cpp: In member function 'unsigned int Foo<Value>::count()':
minimal.cpp:33:19: error: class template argument deduction failed:
   33 |   return SubType<0>().value();
      |                   ^
minimal.cpp:33:19: error: no matching function for call to 'ArgType(ArgType)'
minimal.cpp:8:21: note: candidate: 'template<long unsigned int N> ArgType(const
char (&)[N])-> ArgType<N>'
    8 | template <size_t N> ArgType(const char (&)[N]) -> ArgType<N>;
      |                     ^~~~~~~
minimal.cpp:8:21: note:   template argument deduction/substitution failed:
minimal.cpp:33:19: note:   mismatched types 'const char [N]' and 'ArgType'
   33 |   return SubType<0>().value();
      |                   ^
minimal.cpp:5:12: note: candidate: 'template<long unsigned int N>
ArgType(...)-> ArgType<N>'
    5 |  constexpr ArgType(...) noexcept { }
      |            ^~~~~~~
minimal.cpp:5:12: note:   template argument deduction/substitution failed:
minimal.cpp:33:19: note:   couldn't deduce template parameter 'N'
   33 |   return SubType<0>().value();
      |                   ^
minimal.cpp:4:28: note: candidate: 'template<long unsigned int N>
ArgType(ArgType<N>)-> ArgType<N>'
    4 | template <size_t N> struct ArgType {
      |                            ^~~~~~~
minimal.cpp:4:28: note:   template argument deduction/substitution failed:
minimal.cpp:33:19: note:   mismatched types 'ArgType<N>' and 'ArgType'
   33 |   return SubType<0>().value();
      |                   ^


More information about the Gcc-bugs mailing list