diff options
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r-- | gcc/cp/class.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 30323f0..4616d8d 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -370,6 +370,15 @@ build_base_path (enum tree_code code, goto indout; } + if (!COMPLETE_TYPE_P (probe)) + { + if (complain & tf_error) + error ("cannot convert from %qT to base class %qT because %qT is " + "incomplete", BINFO_TYPE (d_binfo), BINFO_TYPE (binfo), + BINFO_TYPE (d_binfo)); + return error_mark_node; + } + /* If we're in an NSDMI, we don't have the full constructor context yet that we need for converting to a virtual base, so just build a stub CONVERT_EXPR and expand it later in bot_replace. */ |