[LLVMbugs] [Bug 20718] New: wrong handling of qualification conversion on top-level pointer/reference parameter in template argument deduction

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 20 20:03:59 PDT 2014


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

            Bug ID: 20718
           Summary: wrong handling of qualification conversion on
                    top-level pointer/reference parameter in template
                    argument deduction
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Clang (and, it seems, EDG) rejects this valid code:

  template<typename T> struct X { typedef typename T::blah type; };
  template<class T>
  void deduce(typename X<T>::type, const T**) { }
  void deduce(...);

  int main() {
    int **r;
    deduce(0, r);
  }

... because we incorrectly deduce T=int, then fail when substituting back into
X<T>::type. Per 14.8.2.1/4 bullets 1 and 2, we're only supposed to allow
cv-qualification mismatches here if they can be resolved by a qualification
conversion.

GCC gets this right.

-- 
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/20140821/1c862a0d/attachment.html>


More information about the llvm-bugs mailing list