shafik added inline comments.
================ Comment at: clang/test/AST/Interp/arrays.cpp:69 +constexpr int const * ap1 = &arr[0]; +constexpr int const * ap2 = ap1 + 3; // expected-error {{must be initialized by a constant expression}} \ + // expected-note {{cannot refer to element 3 of array of 2}} \ ---------------- We should also have a test for addition out of bounds but subsequent addition bringing it back in bounds. Still UB but we should verify it: https://godbolt.org/z/c1MWjGdfT Apparently gcc does not catch this one. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135858/new/ https://reviews.llvm.org/D135858 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits