Skip to content

[C++20] [Modules] The entity with internal linkage shouldn't be accessed in other TU even if they are in the same module  #61427

Closed
@ChuanqiXu9

Description

@ChuanqiXu9

Reproducer:

export module m:a;
static int a = 32;
export module m:b;
import :a;
int b() {
    return a;
}

Currently the reproducer is accepted. But we expect the compiler to reject it and saying that the partition b can't access the static variable 'a' in partition a.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:modulesC++20 modules and Clang Header Modules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions