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

Empty base of class with trivial default constructor is not initialized in constant expression #19384

Closed
llvmbot opened this issue Feb 28, 2014 · 1 comment
Labels
bugzilla Issues migrated from bugzilla c++11

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 28, 2014

Bugzilla Link 19010
Resolution FIXED
Resolved on Mar 08, 2014 06:19
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

The trunk version of clang fails to compile the following test:

struct Empty {};

struct Empty2 : Empty {};

struct Test : Empty2 {
constexpr Test() {}
};

void test() {
constexpr Test t;
}

clang++ --std=c++1y test.cpp
test.cpp:10:18: error: constexpr variable 't' must be initialized by a constant expression
constexpr Test t;
^
test.cpp:10:18: note: subobject of type 'Empty' is not initialized
1 error generated.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Mar 8, 2014

Fixed in r203025.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
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

1 participant