-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
Description
Bugzilla Link | 9233 |
Resolution | FIXED |
Resolved on | Jun 17, 2011 00:32 |
Version | trunk |
OS | Linux |
CC | @DougGregor |
Extended Description
In this code:
template 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.