From 39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df Mon Sep 17 00:00:00 2001
From: dim <dim@FreeBSD.org>
Date: Sun, 20 Feb 2011 13:06:31 +0000
Subject: Vendor import of clang trunk r126079:
 http://llvm.org/svn/llvm-project/cfe/trunk@126079

---
 test/SemaCXX/constructor-initializer.cpp | 35 +++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

(limited to 'test/SemaCXX/constructor-initializer.cpp')

diff --git a/test/SemaCXX/constructor-initializer.cpp b/test/SemaCXX/constructor-initializer.cpp
index 31d5330..e439a76 100644
--- a/test/SemaCXX/constructor-initializer.cpp
+++ b/test/SemaCXX/constructor-initializer.cpp
@@ -144,9 +144,13 @@ int IntWrapper(int i) { return 0; };
 class InitializeUsingSelfExceptions {
   int A;
   int B;
+  int C;
+  void *P;
   InitializeUsingSelfExceptions(int B)
       : A(IntWrapper(A)),  // Due to a conservative implementation, we do not report warnings inside function/ctor calls even though it is possible to do so.
-        B(B) {}  // Not a warning; B is a local variable.
+        B(B),  // Not a warning; B is a local variable.
+        C(sizeof(C)),  // sizeof doesn't reference contents, do not warn
+        P(&P) {} // address-of doesn't reference contents (the pointer may be dereferenced in the same expression but it would be rare; and weird)
 };
 
 class CopyConstructorTest {
@@ -235,3 +239,32 @@ namespace test3 {
     }
   };
 }
+
+// PR8075
+namespace PR8075 {
+
+struct S1 {
+  enum { FOO = 42 };
+  static const int bar = 42;
+  static int baz();
+  S1(int);
+};
+
+const int S1::bar;
+
+struct S2 {
+  S1 s1;
+  S2() : s1(s1.FOO) {}
+};
+
+struct S3 {
+  S1 s1;
+  S3() : s1(s1.bar) {}
+};
+
+struct S4 {
+  S1 s1;
+  S4() : s1(s1.baz()) {}
+};
+
+}
-- 
cgit v1.1