https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119567

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <[email protected]>:

https://gcc.gnu.org/g:b183634956ae52ceafca5c32f70bb60ebbf7e34c

commit r17-288-gb183634956ae52ceafca5c32f70bb60ebbf7e34c
Author: Andrew Pinski <[email protected]>
Date:   Sun Apr 19 22:05:33 2026 -0700

    c++: Handle EXACT_DIV_EXPR as printing `/` [PR119567]

    Before r8-4233-g6ff16d19d26a41, we would print EXACT_DIV_EXPR as `(ceiling
/)`
    which is wrong. Now we print it as `unknown operator` which is also wrong.
    Printing it as `/` is correct here since it is the similar to
`FLOOR_DIV_EXPR`
    except it is undefined behavior if it is not exact (so floor is fine :)).
    This shows up when printing out the reason why the following is not a
contexpr:
    constexpr int (*p1)[0] = 0, (*p2)[0] = 0;
    constexpr int k2 = p2 - p1;

    Bootstrapped and tested on x86_64-linux-gnu.

            PR c++/119567
    gcc/cp/ChangeLog:

            * error.cc (dump_expr): Treat EXACT_DIV_EXPR the same as
FLOOR_DIV_EXPR.

    Signed-off-by: Andrew Pinski <[email protected]>

Reply via email to