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

--- Comment #2 from John McFarlane <john at mcfarlane dot name> ---
Here are two more:

    constexpr int dubious_increment(int i) { return ++i + ++i; }
    static_assert(dubious_increment(0) == 3);

    constexpr int dubious_increment(int i) { return ++++i; }
    static_assert(dubious_increment(0) == 2);

The former might be a special case because it produces warnings when compiled
at a high-enough warning level (-Wall) but continues to compile nevertheless.
(Clan, warns at any level but also happily compiles.) The second just compiles
without warning no matter what.

Would these be classes as the same issue or should I submit a separate report?
Also, I'm not trying very hard to find these so I suspect there are more.

Reply via email to