diff options
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r-- | gcc/cp/error.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 3e91115ba9d..28305d22244 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -2493,7 +2493,11 @@ location_of (tree t) if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t)) t = DECL_CONTEXT (t); else if (TYPE_P (t)) - t = TYPE_MAIN_DECL (t); + { + t = TYPE_MAIN_DECL (t); + if (t == NULL_TREE) + return input_location; + } else if (TREE_CODE (t) == OVERLOAD) t = OVL_FUNCTION (t); |