summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/constructor-initializer.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-15 08:51:10 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-15 08:51:10 +0000
commit598caeee376ad4ff58d4e77e03782b9d084df748 (patch)
tree01c08a5bf8d9e0b177c228a352b8303732d88568 /clang/test/SemaCXX/constructor-initializer.cpp
parent54fdb417fec84efdb1f0fe18dff21c48f4da54b8 (diff)
downloadbcm5719-llvm-598caeee376ad4ff58d4e77e03782b9d084df748.tar.gz
bcm5719-llvm-598caeee376ad4ff58d4e77e03782b9d084df748.zip
Don't gratuitously mark the default constructors of base or member initializers as used
llvm-svn: 88847
Diffstat (limited to 'clang/test/SemaCXX/constructor-initializer.cpp')
-rw-r--r--clang/test/SemaCXX/constructor-initializer.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/constructor-initializer.cpp b/clang/test/SemaCXX/constructor-initializer.cpp
index ec871764cf9..43186013aaa 100644
--- a/clang/test/SemaCXX/constructor-initializer.cpp
+++ b/clang/test/SemaCXX/constructor-initializer.cpp
@@ -158,3 +158,18 @@ class CopyConstructorTest {
B(B), // expected-warning {{field is uninitialized when used here}}
C(rhs.C || C) { } // expected-warning {{field is uninitialized when used here}}
};
+
+// Make sure we aren't marking default constructors when we shouldn't be.
+template<typename T>
+struct NDC {
+ T &ref;
+
+ NDC() { }
+ NDC(T &ref) : ref(ref) { }
+};
+
+struct X0 : NDC<int> {
+ X0(int &ref) : NDC<int>(ref), ndc(ref) { }
+
+ NDC<int> ndc;
+};
OpenPOWER on IntegriCloud