diff options
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -5170,7 +5170,7 @@ int_fits_type_p (c, type) } /* Given a DECL or TYPE, return the scope in which it was declared, or - NUL_TREE if there is no containing scope. */ + NULL_TREE if there is no containing scope. */ tree get_containing_scope (t) @@ -5193,6 +5193,7 @@ decl_function_context (decl) if (TREE_CODE (decl) == SAVE_EXPR) context = SAVE_EXPR_CONTEXT (decl); + /* C++ virtual functions use DECL_CONTEXT for the class of the vtable where we look up the function at runtime. Such functions always take a first argument of type 'pointer to real context'. @@ -5200,8 +5201,9 @@ decl_function_context (decl) C++ should really be fixed to use DECL_CONTEXT for the real context, and use something else for the "virtual context". */ else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VINDEX (decl)) - context = TYPE_MAIN_VARIANT - (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl))))); + context + = TYPE_MAIN_VARIANT + (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl))))); else context = DECL_CONTEXT (decl); |