[llvm-bugs] [Bug 37866] New: no matching function for call

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 19 22:59:20 PDT 2018


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

            Bug ID: 37866
           Summary: no matching function for call
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zhonghao at pku.org.cn
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

The code sample is as follow:

enum { E = 2 };
template <bool> void f(int) {}
template <int> void f() {}

int
main ()
{
 f<1 * 1>();
 f<1 << 1>();
 f<1 ? 3 : 2>();
 f<E>();

 f<1 * 1>(0);
 f<1 << 1>(0);
 f<1 ? 3 : 2>(0);
 f<E>(0);
}

clang++ rejects it with error messages:
error: no matching function for call to 'f'
     f<1 << 1>(0);
error: no matching function for call to 'f'
     f<1 ? 3 : 2>(0);

The code comes from the test suite of gcc
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79184)

Is this a bug in clang++ or in the test suite of gcc?

-- 
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/20180620/684363d3/attachment-0001.html>


More information about the llvm-bugs mailing list