This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77830] internal compiler error: in output_constructor_regular_field, at varasm.c:4968, when using constexpr (with testcase)
- From: "asad78611 at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 03 Oct 2016 17:26:50 +0000
- Subject: [Bug c++/77830] internal compiler error: in output_constructor_regular_field, at varasm.c:4968, when using constexpr (with testcase)
- Auto-submitted: auto-generated
- References: <bug-77830-4@http.gcc.gnu.org/bugzilla/>
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.