[LLVMbugs] [Bug 15291] New: Noreturn adjustment in overload resolution for function templates

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Feb 17 01:45:43 PST 2013


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

            Bug ID: 15291
           Summary: Noreturn adjustment in overload resolution for
                    function templates
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ftynse at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Overload resolution allows functions to be passed with implicit noreturn
adjustment, but does not allow the same for function templates.

Example:

void __attribute__((noreturn)) func(int i) {}

template <typename T>
void __attribute__((noreturn)) tfunc(T t) {}

typedef void (*ptr)(int);

void foo(ptr p) {}

void bar() {
  foo(func); // Okay
  foo(tfunc<int>); // Error: ... candidate function 'foo' not viable
}

Other attributed functions, e.g. with Microsoft calling convention attributes,
may be subject to this issue as well.

Possible place to look at: Sema::ResolveAddressOfOverloadedFunction
(SemaOverload.cpp).

rjmccall: The problem is almost certainly that template argument deduction
should permit an inexact match requiring a noreturn conversion in the same
sorts of places that it would permit an inexact match requiring a qualification
conversion.

-- 
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/20130217/d62dc3ef/attachment.html>


More information about the llvm-bugs mailing list