[LLVMbugs] [Bug 12443] New: substitution succeeds if a variadic parameter is only used in a non-deduced context

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 2 17:52:37 PDT 2012


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

             Bug #: 12443
           Summary: substitution succeeds if a variadic parameter is only
                    used in a non-deduced context
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Clang rejects this:

template<typename...T> struct S {
  static_assert(sizeof...(T), "");
  S(void (*)(int));
};

struct U {};
template<typename...T> int operator+(U, S<T...>);

void f();
void f(int);

int k = U() + f;

... because the static_assert fires. If the static_assert is removed, the code
compiles. Deduction on operator+ is succeeding without deducing any arguments
for T, resulting in us using operator+(U, S<>).

By 14.8.2/1, this deduction should fail, since no value has been deduced for T.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list