This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/64603] New: [5 Regression] bogus error "no matching function for call to ..." with templates


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

            Bug ID: 64603
           Summary: [5 Regression] bogus error "no matching function for
                    call to ..." with templates
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: janus at gcc dot gnu.org

Created attachment 34452
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34452&action=edit
source file

The attached source file compiles fine with g++ 4.9.1, 4.8.3 and 4.7.4.

However, it is rejected with current trunk builds:

$ g++-5.0 logging.cc -std=c++11
logging.cc: In function âvoid create_all_loggers()â:
logging.cc:33:62: error: no matching function for call to
âcreate_all_loggers_impl()â
   create_all_loggers_impl<std::tuple_size<AreaTuple>::value>();
                                                              ^
logging.cc:26:52: note: candidate: template<long unsigned int index, int
<anonymous> > typename std::enable_if<(index == 0)>::type
create_all_loggers_impl()
 inline typename std::enable_if<(index == 0)>::type create_all_loggers_impl()
{}
                                                    ^
logging.cc:26:52: note:   template argument deduction/substitution failed:
logging.cc: In substitution of âtemplate<long unsigned int index, int
<anonymous> > typename std::enable_if<(index == 0)>::type
create_all_loggers_impl() [with long unsigned int index = 1ul; int <anonymous>
= <missing>]â:
logging.cc:33:62:   required from here
logging.cc:26:52: error: no type named âtypeâ in âstruct std::enable_if<false,
void>â
logging.cc:30:52: note: candidate: template<long unsigned int index, int
longest_name> typename std::enable_if<(index != 0)>::type
create_all_loggers_impl()
 inline typename std::enable_if<(index != 0)>::type create_all_loggers_impl()
{}
                                                    ^
logging.cc:30:52: note:   template argument deduction/substitution failed:
logging.cc:29:61:   in constexpr expansion of âfind_longest_logger_name<1ul>()â
logging.cc:29:62: error: â(((int)(((unsigned int)5ul) + 4294967295u)) > 0)â is
not a constant expression
           int longest_name = find_longest_logger_name<index>()>
                                                              ^
logging.cc:29:62: note: in template argument for type âintâ

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]