From a808c544f9df4d17cb189ba6aa167478cf17ad4a Mon Sep 17 00:00:00 2001 From: Sebastian Redl Date: Sat, 12 Mar 2011 13:44:23 +0000 Subject: [PATCH] Disable inherited constructors for 2.9. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127541 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticSemaKinds.td | 2 ++ lib/Sema/SemaDeclCXX.cpp | 10 +++++++--- test/CXX/special/class.inhctor/elsewhere.cpp | 4 +++- test/CXX/special/class.inhctor/p3.cpp | 4 +++- test/CXX/special/class.inhctor/p7.cpp | 4 +++- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 3a6c43c269..9a2d8d3c7a 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -164,6 +164,8 @@ def err_using_decl_nested_name_specifier_is_current_class : Error< "using declaration refers to its own class">; def err_using_decl_nested_name_specifier_is_not_base_class : Error< "using declaration refers into '%0', which is not a base class of %1">; +def err_using_decl_inherited_constructor_unsupported : Error< + "inherited constructors are not supported">; def err_using_decl_constructor_not_in_direct_base : Error< "%0 is not a direct base of %1, can not inherit constructors">; def err_using_decl_constructor_conflict : Error< diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index f6551054c1..7a597be871 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -2898,7 +2898,8 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) { // waste space and performance on classes that are not meant to be // instantiated (e.g. meta-functions). This doesn't apply to classes that // have inherited constructors. - DeclareInheritedConstructors(Record); + // Disabled for 2.9 + //DeclareInheritedConstructors(Record); } /// \brief Data used with FindHiddenVirtualMethod @@ -4324,8 +4325,11 @@ NamedDecl *Sema::BuildUsingDeclaration(Scope *S, AccessSpecifier AS, // Constructor inheriting using decls get special treatment. if (NameInfo.getName().getNameKind() == DeclarationName::CXXConstructorName) { - if (CheckInheritedConstructorUsingDecl(UD)) - UD->setInvalidDecl(); + // Disabled for 2.9 + Diag(UD->getLocation(), + diag::err_using_decl_inherited_constructor_unsupported); + //if (CheckInheritedConstructorUsingDecl(UD)) + UD->setInvalidDecl(); return UD; } diff --git a/test/CXX/special/class.inhctor/elsewhere.cpp b/test/CXX/special/class.inhctor/elsewhere.cpp index 82944d65df..83eeb00bf9 100644 --- a/test/CXX/special/class.inhctor/elsewhere.cpp +++ b/test/CXX/special/class.inhctor/elsewhere.cpp @@ -1,4 +1,6 @@ -// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s +// RUN: true +// Disabled for 2.9 +//%clang_cc1 -std=c++0x -fsyntax-only -verify %s // Tests related to constructor inheriting, but not specified in [class.inhctor] diff --git a/test/CXX/special/class.inhctor/p3.cpp b/test/CXX/special/class.inhctor/p3.cpp index 021f701ab4..be75b6c310 100644 --- a/test/CXX/special/class.inhctor/p3.cpp +++ b/test/CXX/special/class.inhctor/p3.cpp @@ -1,4 +1,6 @@ -// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s +// RUN: true +// Disabled for 2.9 +//%clang_cc1 -std=c++0x -fsyntax-only -verify %s struct B1 { B1(int); diff --git a/test/CXX/special/class.inhctor/p7.cpp b/test/CXX/special/class.inhctor/p7.cpp index 3ad761f08b..4f80896485 100644 --- a/test/CXX/special/class.inhctor/p7.cpp +++ b/test/CXX/special/class.inhctor/p7.cpp @@ -1,4 +1,6 @@ -// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s +// RUN: true +// Disabled for 2.9 +//%clang_cc1 -std=c++0x -fsyntax-only -verify %s // Straight from the standard struct B1 { -- 2.40.0