From 598caeee376ad4ff58d4e77e03782b9d084df748 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sun, 15 Nov 2009 08:51:10 +0000 Subject: Don't gratuitously mark the default constructors of base or member initializers as used llvm-svn: 88847 --- clang/test/SemaCXX/constructor-initializer.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'clang/test/SemaCXX/constructor-initializer.cpp') 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 +struct NDC { + T &ref; + + NDC() { } + NDC(T &ref) : ref(ref) { } +}; + +struct X0 : NDC { + X0(int &ref) : NDC(ref), ndc(ref) { } + + NDC ndc; +}; -- cgit v1.2.3