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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to