From 6a6376b17cdf6c0adf8e52a298beff75079d932a 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 llvm-svn: 261297 --- clang/lib/Serialization/ASTReaderDecl.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp') diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index 7aa6d5236c6..bf60ba9478a 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -1412,6 +1412,7 @@ void ASTDeclReader::ReadCXXDefinitionData( Data.HasOnlyCMembers = Record[Idx++]; Data.HasInClassInitializer = Record[Idx++]; Data.HasUninitializedReferenceMember = Record[Idx++]; + Data.HasUninitializedFields = Record[Idx++]; Data.NeedOverloadResolutionForMoveConstructor = Record[Idx++]; Data.NeedOverloadResolutionForMoveAssignment = Record[Idx++]; Data.NeedOverloadResolutionForDestructor = Record[Idx++]; @@ -1536,6 +1537,7 @@ void ASTDeclReader::MergeDefinitionData( MATCH_FIELD(HasOnlyCMembers) MATCH_FIELD(HasInClassInitializer) MATCH_FIELD(HasUninitializedReferenceMember) + MATCH_FIELD(HasUninitializedFields) MATCH_FIELD(NeedOverloadResolutionForMoveConstructor) MATCH_FIELD(NeedOverloadResolutionForMoveAssignment) MATCH_FIELD(NeedOverloadResolutionForDestructor) -- cgit v1.2.3