On Tue, Nov 08, 2022 at 02:36:17PM +0000, Julian Brown wrote:
> @@ -3258,6 +3273,7 @@ c_omp_address_inspector::get_origin (tree t)
>              || TREE_CODE (t) == SAVE_EXPR)
>       t = TREE_OPERAND (t, 0);
>        else if (TREE_CODE (t) == INDIRECT_REF
> +            && TREE_TYPE (TREE_OPERAND (t, 0))
>              && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == REFERENCE_TYPE)
>       t = TREE_OPERAND (t, 0);
>        else
> @@ -3274,7 +3290,9 @@ c_omp_address_inspector::get_origin (tree t)
>  tree
>  c_omp_address_inspector::maybe_unconvert_ref (tree t)
>  {
> +  /* The TREE_TYPE can be null if we had an earlier error.  */
>    if (TREE_CODE (t) == INDIRECT_REF
> +      && TREE_TYPE (TREE_OPERAND (t, 0))
>        && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == REFERENCE_TYPE)
>      return TREE_OPERAND (t, 0);
>  

I'd prefer avoiding changes like the above.
If we had an earlier error, it should be error_mark_node or have
error_mark_node type, not NULL.
NULL type means something different in the C++ FE, in particular that
something is type dependent and the type will be only figured out after
instantiation.

Other than that LGTM.

        Jakub

Reply via email to