Skip to content

Compiler error in g++ #2

@micsolutions

Description

@micsolutions

Declaring an array with auto using constexpr will result in an internal compiler error when using riscv32-unknown-elf-g++:

  // 1) No problems:
  constexpr std::array<float, 3> test1 = {1.0f, 2.0f, 3.0f};

  // 2) internal compiler error
  constexpr auto test2 = std::array<float, 3>{1.0f, 2.0f, 3.0f};

Here is the full error message:

internal compiler error: in reshape_init_r, at cp/decl.c:6043
   constexpr auto test2 = std::array<float, 3>{1.0f, 2.0f, 3.0f};
                  ^~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.

- Fabian

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions