[llvm-bugs] [Bug 24626] New: clang incorrectly deduces ambiguous template from base class

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Aug 29 18:15:13 PDT 2015


            Bug ID: 24626
           Summary: clang incorrectly deduces ambiguous template from base
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: brunocodutra at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

clang fails the following static assertion

template<typename, typename>
struct foo {};

struct bar : foo<void, int>, foo<void, int*> {};

template<typename T>
T f(foo<void, T>&&);
void f(...);

static_assert(std::is_same<decltype(f(std::declval<bar>())), void>{}, "");

it turns out clang chooses the first overload of f and incorrectly deduces T to
be int*

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/20150830/e179b835/attachment.html>

More information about the llvm-bugs mailing list