In C++98/03, an uninitialized variable that has POD class type will be
uninitialized. This seems not to be the case in C++0x, where we still
call the (trivial) default constructor for a POD class
(!). Previously, we had implemented only the C++0x rules; now we
implement both. Fixes PR6536.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97928 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CXX/dcl.decl/dcl.init/p6.cpp b/test/CXX/dcl.decl/dcl.init/p6.cpp
index f627a19..df5dcfe 100644
--- a/test/CXX/dcl.decl/dcl.init/p6.cpp
+++ b/test/CXX/dcl.decl/dcl.init/p6.cpp
@@ -5,7 +5,8 @@
 // If a program calls for the default initialization of an object of a
 // const-qualified type T, T shall be a class type with a
 // user-provided default constructor.
-struct NoUserDefault { };
+struct MakeNonPOD { MakeNonPOD(); };
+struct NoUserDefault : public MakeNonPOD { };
 struct HasUserDefault { HasUserDefault(); };
 
 void test_const_default_init() {
diff --git a/test/CodeGenCXX/internal-linkage.cpp b/test/CodeGenCXX/internal-linkage.cpp
index 1ae0f08..4263891 100644
--- a/test/CodeGenCXX/internal-linkage.cpp
+++ b/test/CodeGenCXX/internal-linkage.cpp
@@ -1,11 +1,11 @@
 // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
 
-struct Global { };
-template<typename T> struct X { };
+struct Global { Global(); };
+template<typename T> struct X { X(); };
 
 
 namespace {
-  struct Anon { };
+  struct Anon { Anon(); };
 
   // CHECK: @_ZN12_GLOBAL__N_15anon0E = internal global
   Global anon0;
diff --git a/test/SemaCXX/statements.cpp b/test/SemaCXX/statements.cpp
index 852086e..0e27f46 100644
--- a/test/SemaCXX/statements.cpp
+++ b/test/SemaCXX/statements.cpp
@@ -15,3 +15,8 @@
 later:
   ;
 }
+
+namespace PR6536 {
+  struct A {};
+  void a() { goto out; A x; out: return; }
+}