From 309e7e9be3b249095885c91b0928d183bee9ef6f Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 19 Feb 2016 01:52:46 +0000 Subject: Implement the likely resolution of core issue 253. C++11 requires const objects to have a user-provided constructor, even for classes without any fields. DR 253 relaxes this to say "If the implicit default constructor initializes all subobjects, no initializer should be required." clang is currently the only compiler that implements this C++11 rule, and e.g. libstdc++ relies on something like DR 253 to compile in newer versions. This change makes it possible to build code that says `const vector v;' again when using libstdc++5.2 and _GLIBCXX_DEBUG (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60284). Fixes PR23381. http://reviews.llvm.org/D16552 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261297 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp') diff --git a/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp b/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp index 5cf281c185..c2f3b5a045 100644 --- a/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp +++ b/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp @@ -116,6 +116,7 @@ static_assert(!noexcept(e5 = e5), ""); namespace PR13492 { struct B { B() = default; + int field; }; void f() { -- cgit v1.2.3