Extended Description
Clang fails to report an error that it "cannot assign to variable 'b' with const-qualified type" given the following piece of code:
template
struct A
{
struct B {};
const B* test (const B* b) const;
};
template
inline auto A< T >::test (const B* const b) const -> const B*
{
return ++b; // expected an error here
}
int main()
{
A<> m;
const A<>::B* b = 0;
b = m.test (b);
}
The AST dumps show that the specialisation of method test from class A has the following parameter declaration:
ParmVarDecl 0x7fba11802228 <col:17, col:26> col:26 used b 'const struct A::B *'
but the non-specialised definition of the method test has the following parameter declaration:
ParmVarDecl 0x7fba11800e90 <col:27, col:42> col:42 referenced b 'const struct A::B *const'
This makes me think that the error isn't reported because the 'const' qualifier isn't given to the parameter in the specialised method definition.