[LLVMbugs] [Bug 17521] New: function template arguments deduction problem

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 9 04:25:07 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17521

            Bug ID: 17521
           Summary: function template arguments deduction problem
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: gruzovator at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11351
  --> http://llvm.org/bugs/attachment.cgi?id=11351&action=edit
problem. clang++ & g++ comparison

clang++ 3.3 & 3.4.

Argument deduction should fail for function template
template<class T> void tf(const T*) when pointer to function is passing as arg.

Example:

#include <iostream>

template<class T> void tf(const T*) {  // 1. clang++ 
    std::cout << "void tf(const T*)\n"; 
}

template<class T> void tf(T) {  // 2. g++ 4.8.1
    std::cout << "void tf(T)\n"; 
}

int main(){ 
    tf(std::hex);
}

It seems to me that according to C++ 03 compiler have to select second version
of tf. Cause pointer to a function can't be cv - qualified.

-- 
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/20131009/8efbb99c/attachment.html>


More information about the llvm-bugs mailing list