Index: cp/typeck.c =================================================================== --- cp/typeck.c (revision 210205) +++ cp/typeck.c (working copy) @@ -8094,6 +8094,13 @@ convert_for_assignment (tree type, tree rhs, default: gcc_unreachable(); } + if (TYPE_PTR_P (rhstype) + && TYPE_PTR_P (type) + && CLASS_TYPE_P (TREE_TYPE (rhstype)) + && CLASS_TYPE_P (TREE_TYPE (type)) + && !COMPLETE_TYPE_P (TREE_TYPE (rhstype))) + inform (input_location, "class type %qT is incomplete", + TREE_TYPE (rhstype)); } return error_mark_node; } Index: testsuite/g++.dg/diagnostic/pr13981.C =================================================================== --- testsuite/g++.dg/diagnostic/pr13981.C (revision 0) +++ testsuite/g++.dg/diagnostic/pr13981.C (working copy) @@ -0,0 +1,12 @@ +// PR c++/13981 + +struct A {}; +struct B; + +void func( A *a ); + +int main() +{ + B *b = 0; + func(b); // { dg-error "cannot convert" } +} // { dg-message "is incomplete" "is incomplete" { target *-*-* } 11 }