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

Asad Mehmood <asad78611 at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Asad Mehmood <asad78611 at googlemail dot com> ---
Never mind,

Incorrect source

clang gives a more informative error:

test.cpp:35:18: error: constexpr variable 'a' must be initialized by a constant
expression
  constexpr auto a = create_parser("A","B","C");
                 ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~
test.cpp:20:23: note: assignment to dereferenced one-past-the-end pointer is
not allowed in a constant expression
      this->arr[i][j] = 0;
                      ^
test.cpp:29:7: note: in call to '&p->setMember(&"A"[0], 0)'
    p.setMember(strings[i], i);
      ^
test.cpp:35:22: note: in call to 'create_parser(&"A"[0], &"B"[0], &"C"[0])'
  constexpr auto a = create_parser("A","B","C");
                     ^
1 error generated.

error was on line 13: should have been j < 11.

Reply via email to