http://llvm.org/bugs/show_bug.cgi?id=9233
Summary: Template deduction succeeds despite qualifier mismatch
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
In this code:
template<typename T> void f(const T **q);
int main() {
int **p;
f(p);
}
clang deduces T = int, then decides the function is not viable because of the
qualifier mismatch. This causes the wrong diagnostic to be issued.
[temp.deduct.call]p4, which allows this sort of qualifier mismatch in other
cases, says:
"The transformed A can be another pointer or pointer to member type that can be
converted to the deduced A via a qualification conversion (4.4)."
But "T **" can't be converted to "const T **" via a qualification conversion.
I noticed this while testing:
int **p;
const auto **q = p;
which also gives the wrong diagnostic, for the same reason.
--
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs