Skip to content

injection + modules = internal compiler error #306

@DaemonSnake

Description

@DaemonSnake

Hi!
the following causes clang to crash:

mods/test.mpp:

export module test;

export namespace test {
    template<class T>
    struct type {
      consteval -> namespace(test) fragment namespace {};
    };
}

main.cpp:

import test;

int main() {
  auto x = test::type<int>{};
}

how to compile:

clang++ -fprebuilt-module-path=./mods/ -freflection -std=c++2a -x c++ -c mods/test.mpp -Xclang -emit-module-interface -o mods/test.pcm
clang++ -fprebuilt-module-path=./mods/ -freflection -std=c++2a -c main.cpp -o main.o

I believe the issue is caused here:

// FIXME: The point of instantiation is probably wrong.

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