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

            Bug ID: 127789
           Summary: accepts invalid comparison of unrelated pointers in
                    constant expression
           Product: gcc
           Version: 16.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: leni536 at gmail dot com
  Target Milestone: ---

version: g++ (Compiler-Explorer-Build-gcc--binutils-2.44) 16.2.0
command line options: -std=c++26 -pedantic-errors

# Observed behavior:

The following compiles:

int a;
int b;

constexpr bool c = (&a < &b, true);

https://godbolt.org/z/o8asErW4W

# Expected behavior

A compile error, as &a < &b is not a core constant expression.

Reply via email to