aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/value-initialization.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-11-03 20:38:53 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-11-03 20:38:53 +0000
commit6f26920dfa5020202016b18f52ccd120d9c7e518 (patch)
tree2f7525427fc6e6c287cbf1919abff13c7ae07a27 /test/SemaCXX/value-initialization.cpp
parente6113de52df132b89c3a5a6141f17d37e83322ae (diff)
Remove previous patch for pr5296 due to further clarification
of value-initialization and trivial constructors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85935 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/value-initialization.cpp')
-rw-r--r--test/SemaCXX/value-initialization.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/test/SemaCXX/value-initialization.cpp b/test/SemaCXX/value-initialization.cpp
index 6b99297361..29d866fa64 100644
--- a/test/SemaCXX/value-initialization.cpp
+++ b/test/SemaCXX/value-initialization.cpp
@@ -1,23 +1,10 @@
// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x
struct A {
- ~A();
- const int i; // expected-note {{declared at}}
-};
-
-struct B {
- // B is a non-POD with no user-written constructor.
- // It has a nontrivial generated constructor.
- const int i[12]; // expected-note {{declared at}}
- A a;
+ const int i; // expected-note {{declared at}}
+ virtual void f() { }
};
int main () {
- // Value-initializing a "B" doesn't call the default constructor for
- // "B"; it value-initializes the members of B. Therefore it shouldn't
- // cause an error on generation of the default constructor for the
- // following:
- new B(); // expected-error {{cannot define the implicit default constructor for 'struct B', because const member 'i'}}
- (void)B();
- (void)A(); // expected-error {{cannot define the implicit default constructor for 'struct A', because const member 'i'}}
+ (void)A(); // expected-error {{cannot define the implicit default constructor for 'struct A', because const member 'i' cannot be default-initialized}}
}