Skip to content

[Clang] ICE with forward declares and modules #150581

@kish1n

Description

@kish1n

stack_trace.txt

preprocessed_src.txt
run_command.txt

Here is my best reduction to reproduce. This error has occurred for me on both 20.1.7 and 20.1.8. Interestingly, it does not reproduce on my self-built clang in either Debug or Optimized. Only occurs on the binary from arch repo, so not sure how to go about debugging this.

render_impl.cpp

module lotus:render.impl;

import std;
import :GameObject;
import :State;
import :render;
import :programs;

void BasicTriangleDrawer::draw(State *state) {
    std::vector<float> vertices;
    vertices.reserve(state->objs.size());
}

GameObject.ixx

export module lotus:GameObject;

export class GameObject {};

Render.ixx

export module lotus:render;

import std;
import :State;

export class BasicTriangleDrawer {
  public:
    void draw(State *state);
};

programs.ixx

export module lotus:programs;

export namespace zzz {}

State.ixx

export module lotus:State;

import std;

class GameObject;

export class State {
  public:
    State() = default;

    std::vector<GameObject> objs;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:modulesC++20 modules and Clang Header ModulescrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions