diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-17 00:44:16 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-17 00:44:16 +0000 |
commit | ce582fe2a7aad8b14b3636ad9cac0a3b8bbb219b (patch) | |
tree | b7c2066359564a33dd23dc3fdb171ce9cbc39165 /test/SemaCXX/constexpr-value-init.cpp | |
parent | df79567796fabb406156d881ebd3319aa55b6f83 (diff) |
PR12012: Fix a regression in r150419 where we would try (and fail) to
zero-initialize class types with virtual bases when constant-evaluating an
initializer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150770 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/constexpr-value-init.cpp')
-rw-r--r-- | test/SemaCXX/constexpr-value-init.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/SemaCXX/constexpr-value-init.cpp b/test/SemaCXX/constexpr-value-init.cpp index db4b68dcc6..e459f097b9 100644 --- a/test/SemaCXX/constexpr-value-init.cpp +++ b/test/SemaCXX/constexpr-value-init.cpp @@ -29,3 +29,9 @@ constexpr D d1; // expected-error {{requires a user-provided default constructor constexpr D d2 = D(); // ok with DR1452 static_assert(D().c == 0, ""); static_assert(D().d == 0, ""); + +struct V : virtual C {}; +template<typename T> struct Z : T { + constexpr Z() : V() {} +}; +constexpr int n = Z<V>().c; // expected-error {{constant expression}} expected-note {{virtual base class}} |