summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/aggregate-initialization.cpp
diff options
context:
space:
mode:
authorAlexis Hunt <alercah@gmail.com>2011-05-09 21:45:35 +0000
committerAlexis Hunt <alercah@gmail.com>2011-05-09 21:45:35 +0000
commit88c75c311fc80fb12d7226e93da5db6db1e78b7a (patch)
tree17fdaa85fd0e12bc7311467ffc6edc0c9d73132e /clang/test/SemaCXX/aggregate-initialization.cpp
parentfa92ecc3e875c75ff2fcf926f16a1c6731475683 (diff)
downloadbcm5719-llvm-88c75c311fc80fb12d7226e93da5db6db1e78b7a.tar.gz
bcm5719-llvm-88c75c311fc80fb12d7226e93da5db6db1e78b7a.zip
Clean up trivial default constructors now.
hasTrivialDefaultConstructor() really really means it now. Also implement a fun standards bug regarding aggregates. Doug, if you'd like, I can un-implement that bug if you think it is truly a defect. The bug is that non-special-member constructors are never considered user-provided, so the following is an aggregate: struct foo { foo(int); }; It's kind of bad, but the solution isn't obvious - should struct foo { foo (int) = delete; }; be an aggregate or not? Lastly, add a missing initialization to FunctionDecl. llvm-svn: 131101
Diffstat (limited to 'clang/test/SemaCXX/aggregate-initialization.cpp')
-rw-r--r--clang/test/SemaCXX/aggregate-initialization.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/aggregate-initialization.cpp b/clang/test/SemaCXX/aggregate-initialization.cpp
index 4c34447940f..b9e69b00b7f 100644
--- a/clang/test/SemaCXX/aggregate-initialization.cpp
+++ b/clang/test/SemaCXX/aggregate-initialization.cpp
@@ -2,6 +2,8 @@
// Verify that we can't initialize non-aggregates with an initializer
// list.
+// FIXME: Note that due to a (likely) standard bug, this is technically an
+// aggregate.
struct NonAggr1 {
NonAggr1(int) { }
@@ -22,7 +24,7 @@ struct NonAggr4 {
virtual void f();
};
-NonAggr1 na1 = { 17 }; // expected-error{{non-aggregate type 'NonAggr1' cannot be initialized with an initializer list}}
+NonAggr1 na1 = { 17 };
NonAggr2 na2 = { 17 }; // expected-error{{non-aggregate type 'NonAggr2' cannot be initialized with an initializer list}}
NonAggr3 na3 = { 17 }; // expected-error{{non-aggregate type 'NonAggr3' cannot be initialized with an initializer list}}
NonAggr4 na4 = { 17 }; // expected-error{{non-aggregate type 'NonAggr4' cannot be initialized with an initializer list}}
OpenPOWER on IntegriCloud