[LLVMbugs] [Bug 23207] New: bogus error: no matching function for call to ... (candidate template ignored: substitution failure)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Apr 12 04:01:02 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23207

            Bug ID: 23207
           Summary: bogus error: no matching function for call to ...
                    (candidate template ignored: substitution failure)
           Product: clang
           Version: 3.5
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: janus at gcc.gnu.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14193
  --> https://llvm.org/bugs/attachment.cgi?id=14193&action=edit
test case

Compiling the attached test code with

clang++ logging.cc -std=c++11

results in the following error:

logging.cc:58:3: error: no matching function for call to
'create_all_loggers_impl'
  create_all_loggers_impl<std::tuple_size<AreaTuple>::value>();
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
logging.cc:47:32: note: candidate template ignored: disabled by 'enable_if'
[with index = 18]
inline typename std::enable_if<(index == 0)>::type create_all_loggers_impl() {}
                               ^
logging.cc:51:52: note: candidate template ignored: substitution failure [with
index = 18]: non-type
      template argument is not a constant expression
inline typename std::enable_if<(index != 0)>::type create_all_loggers_impl() {
                                                   ^
1 error generated.


I see the same behaviour with clang 3.4.2 and 3.5.0 (haven't tried other
versions), while g++ 4.7 and upward compiles the file just fine.

Curiously, if I remove the last logarea ('R') in lines 25 and 28, the error
goes away.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150412/116886f5/attachment.html>


More information about the llvm-bugs mailing list