Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eager instantiation of constexpr variables fails if constexpr qualifier is added by static data member definition #24915

Open
zygoloid mannequin opened this issue Aug 21, 2015 · 0 comments
Labels
bugzilla Issues migrated from bugzilla c++11

Comments

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Aug 21, 2015

Bugzilla Link 24541
Version trunk
OS Linux
CC @DougGregor

Extended Description

Consider:

template < class T >
struct Foo {
T v;
constexpr Foo() : v(){}
static const Foo f;
};

template < class T >
constexpr const Foo Foo::f = Foo();

std::array<int, Foostd::size_t::f.v> a;

Clang rejects this, because it doesn't eagerly instantiate Foo<size_t>::f, presumably because the constexpr specifier isn't seen until the out-of-line definition is instantiated.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++11
Projects
None yet
Development

No branches or pull requests

0 participants