From a671bca618cbc1ec452a3d4e8c08391ae13fc97a Mon Sep 17 00:00:00 2001 From: Alexis Hunt Date: Fri, 20 May 2011 21:43:47 +0000 Subject: Add a missing case for default constructor deletion. This case is tested by the fact that the modified test produces significatly worse diagnostics. That's on the list. llvm-svn: 131759 --- clang/lib/Sema/SemaDeclCXX.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/Sema/SemaDeclCXX.cpp') diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 90c840ba7fa..4fc9bf1fdd5 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -3433,6 +3433,11 @@ bool Sema::ShouldDeleteDefaultConstructor(CXXConstructorDecl *CD) { // This is technically non-conformant, but sanity demands it. continue; } + } else if (!Union && FieldType.isConstQualified()) { + // -- any non-variant non-static data member of const-qualified type (or + // array thereof) with no brace-or-equal-initializer does not have a + // user-provided default constructor + return true; } InitializedEntity MemberEntity = -- cgit v1.2.3