Skip to content

[Clang] Accepts invalid constexpr in explicit instantiation of variable template #110873

Open
@MagentaTreehouse

Description

@MagentaTreehouse

In the following code, the constexpr specifier should not be allowed in the explicit instantiation. It is rejected by GCC, but accepted by Clang.

template <class>
inline constexpr int i{};

template constexpr int i<int>;

See Compiler Explorer: https://godbolt.org/z/jzvY3Mqxc

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepts-invalidclang:frontendLanguage frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationdiverges-from:gccDoes the clang frontend diverge from gcc on this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions