aboutsummaryrefslogtreecommitdiff
path: root/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
commitc07a494b376f75f33759cf09ad188b11ef3fa9d5 (patch)
treefdb8169399e3e8da27a75d97a8534aa0741fdc9b /test/SemaCXX/constructor-initializer.cpp
parent891fdae811e991d15b26fc165724c4cf6b6737a6 (diff)
Don't gratuitously mark the default constructors of base or member initializers as used
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88847 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/constructor-initializer.cpp')
-rw-r--r--test/SemaCXX/constructor-initializer.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaCXX/constructor-initializer.cpp b/test/SemaCXX/constructor-initializer.cpp
index ec871764cf..43186013aa 100644
--- a/test/SemaCXX/constructor-initializer.cpp
+++ b/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;
+};