Index: include/clang/AST/Decl.h =================================================================== --- include/clang/AST/Decl.h +++ include/clang/AST/Decl.h @@ -1861,11 +1861,6 @@ /// allocation function. [...] bool isReplaceableGlobalAllocationFunction() const; - /// \brief Determine whether this function is a sized global deallocation - /// function in C++1y. If so, find and return the corresponding unsized - /// deallocation function. - FunctionDecl *getCorrespondingUnsizedGlobalDeallocationFunction() const; - /// Compute the language linkage. LanguageLinkage getLanguageLinkage() const; Index: include/clang/Basic/LangOptions.def =================================================================== --- include/clang/Basic/LangOptions.def +++ include/clang/Basic/LangOptions.def @@ -165,7 +165,6 @@ LANGOPT(AssumeSaneOperatorNew , 1, 1, "implicit __attribute__((malloc)) for C++'s new operators") LANGOPT(SizedDeallocation , 1, 0, "enable sized deallocation functions") -LANGOPT(DefineSizedDeallocation , 1, 0, "generate weak definitions of sized delete") BENIGN_LANGOPT(ElideConstructors , 1, 1, "C++ copy constructor elision") BENIGN_LANGOPT(DumpRecordLayouts , 1, 0, "dumping the layout of IRgen'd records") BENIGN_LANGOPT(DumpRecordLayoutsSimple , 1, 0, "dumping the layout of IRgen'd records in a simple form") Index: include/clang/Driver/CC1Options.td =================================================================== --- include/clang/Driver/CC1Options.td +++ include/clang/Driver/CC1Options.td @@ -518,12 +518,6 @@ HelpText<"Defines the __DEPRECATED macro">; def fno_deprecated_macro : Flag<["-"], "fno-deprecated-macro">, HelpText<"Undefines the __DEPRECATED macro">; -def fsized_deallocation : Flag<["-"], "fsized-deallocation">, - HelpText<"Enable C++14 sized global deallocation functions">; -def fno_sized_deallocation: Flag<["-"], "fno-sized-deallocation">, - HelpText<"Disable sized deallocation functions">; -def fdefine_sized_deallocation: Flag<["-"], "fdefine-sized-deallocation">, - HelpText<"Allow compiler-generated definition of sized deallocation functions">; def fobjc_subscripting_legacy_runtime : Flag<["-"], "fobjc-subscripting-legacy-runtime">, HelpText<"Allow Objective-C array and dictionary subscripting in legacy runtime">; def vtordisp_mode_EQ : Joined<["-"], "vtordisp-mode=">, Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -830,6 +830,9 @@ HelpText<"Restrict code to those available for App Extensions">; def fno_application_extension : Flag<["-"], "fno-application-extension">, Group; +def fsized_deallocation : Flag<["-"], "fsized-deallocation">, Flags<[CC1Option]>, + HelpText<"Enable C++14 sized global deallocation functions">, Group; +def fno_sized_deallocation: Flag<["-"], "fno-sized-deallocation">, Group; def fobjc_gc_only : Flag<["-"], "fobjc-gc-only">, Group, Flags<[CC1Option]>, HelpText<"Use GC exclusively for Objective-C related memory management">; Index: lib/AST/Decl.cpp =================================================================== --- lib/AST/Decl.cpp +++ lib/AST/Decl.cpp @@ -2501,7 +2501,7 @@ // 'const std::nothrow_t &', or, in C++1y, 'std::size_t'. QualType Ty = FPT->getParamType(1); ASTContext &Ctx = getASTContext(); - if (Ctx.getLangOpts().SizedDeallocation && + if (Ctx.getLangOpts().CPlusPlus14 && Ctx.hasSameType(Ty, Ctx.getSizeType())) return true; if (!Ty->isReferenceType()) @@ -2513,39 +2513,6 @@ return RD && isNamed(RD, "nothrow_t") && RD->isInStdNamespace(); } -FunctionDecl * -FunctionDecl::getCorrespondingUnsizedGlobalDeallocationFunction() const { - ASTContext &Ctx = getASTContext(); - if (!Ctx.getLangOpts().SizedDeallocation) - return nullptr; - - if (getDeclName().getNameKind() != DeclarationName::CXXOperatorName) - return nullptr; - if (getDeclName().getCXXOverloadedOperator() != OO_Delete && - getDeclName().getCXXOverloadedOperator() != OO_Array_Delete) - return nullptr; - if (isa(getDeclContext())) - return nullptr; - - if (!getDeclContext()->getRedeclContext()->isTranslationUnit()) - return nullptr; - - if (getNumParams() != 2 || isVariadic() || - !Ctx.hasSameType(getType()->castAs()->getParamType(1), - Ctx.getSizeType())) - return nullptr; - - // This is a sized deallocation function. Find the corresponding unsized - // deallocation function. - lookup_result R = getDeclContext()->lookup(getDeclName()); - for (lookup_result::iterator RI = R.begin(), RE = R.end(); RI != RE; - ++RI) - if (FunctionDecl *FD = dyn_cast(*RI)) - if (FD->getNumParams() == 1 && !FD->isVariadic()) - return FD; - return nullptr; -} - LanguageLinkage FunctionDecl::getLanguageLinkage() const { return getDeclLanguageLinkage(*this); } Index: lib/CodeGen/CodeGenFunction.cpp =================================================================== --- lib/CodeGen/CodeGenFunction.cpp +++ lib/CodeGen/CodeGenFunction.cpp @@ -802,20 +802,6 @@ F->setDoesNotThrow(); } -static void EmitSizedDeallocationFunction(CodeGenFunction &CGF, - const FunctionDecl *UnsizedDealloc) { - // This is a weak discardable definition of the sized deallocation function. - CGF.CurFn->setLinkage(llvm::Function::LinkOnceAnyLinkage); - if (CGF.CGM.supportsCOMDAT()) - CGF.CurFn->setComdat( - CGF.CGM.getModule().getOrInsertComdat(CGF.CurFn->getName())); - - // Call the unsized deallocation function and forward the first argument - // unchanged. - llvm::Constant *Unsized = CGF.CGM.GetAddrOfFunction(UnsizedDealloc); - CGF.Builder.CreateCall(Unsized, &*CGF.CurFn->arg_begin()); -} - void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn, const CGFunctionInfo &FnInfo) { const FunctionDecl *FD = cast(GD.getDecl()); @@ -891,14 +877,6 @@ emitImplicitAssignmentOperatorBody(Args); } else if (Stmt *Body = FD->getBody()) { EmitFunctionBody(Args, Body); - } else if (FunctionDecl *UnsizedDealloc = - FD->getCorrespondingUnsizedGlobalDeallocationFunction()) { - // Global sized deallocation functions get an implicit weak definition if - // they don't have an explicit definition, if allowed. - assert(getLangOpts().DefineSizedDeallocation && - "Can't emit unallowed definition."); - EmitSizedDeallocationFunction(*this, UnsizedDealloc); - } else llvm_unreachable("no definition for emitted function"); Index: lib/CodeGen/CodeGenModule.cpp =================================================================== --- lib/CodeGen/CodeGenModule.cpp +++ lib/CodeGen/CodeGenModule.cpp @@ -1620,16 +1620,6 @@ // don't need it anymore). addDeferredDeclToEmit(F, DDI->second); DeferredDecls.erase(DDI); - - // Otherwise, if this is a sized deallocation function, emit a weak - // definition for it at the end of the translation unit (if allowed), - // unless the sized deallocation function is aliased. - } else if (D && - cast(D) - ->getCorrespondingUnsizedGlobalDeallocationFunction() && - getLangOpts().DefineSizedDeallocation && - !D->hasAttr()) { - addDeferredDeclToEmit(F, GD); // Otherwise, there are cases we have to worry about where we're // using a declaration for which we must emit a definition but where Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -4250,6 +4250,12 @@ options::OPT_fno_assume_sane_operator_new)) CmdArgs.push_back("-fno-assume-sane-operator-new"); + // -fsized-deallocation is off by default, as it is an ABI-breaking change for + // most platforms. + if (Args.hasFlag(options::OPT_fsized_deallocation, + options::OPT_fno_sized_deallocation, false)) + CmdArgs.push_back("-fsized-deallocation"); + // -fconstant-cfstrings is default, and may be subject to argument translation // on Darwin. if (!Args.hasFlag(options::OPT_fconstant_cfstrings, Index: lib/Frontend/CompilerInvocation.cpp =================================================================== --- lib/Frontend/CompilerInvocation.cpp +++ lib/Frontend/CompilerInvocation.cpp @@ -1263,9 +1263,6 @@ Opts.CXXOperatorNames = Opts.CPlusPlus; Opts.DollarIdents = !Opts.AsmPreprocessor; - - // C++14 onwards has sized global deallocation functions. - Opts.SizedDeallocation = Opts.CPlusPlus14; } /// Attempt to parse a visibility value out of the given argument. @@ -1544,10 +1541,7 @@ Opts.NoBuiltin = Args.hasArg(OPT_fno_builtin) || Opts.Freestanding; Opts.NoMathBuiltin = Args.hasArg(OPT_fno_math_builtin); Opts.AssumeSaneOperatorNew = !Args.hasArg(OPT_fno_assume_sane_operator_new); - Opts.SizedDeallocation |= Args.hasArg(OPT_fsized_deallocation); - Opts.SizedDeallocation &= !Args.hasArg(OPT_fno_sized_deallocation); - Opts.DefineSizedDeallocation = Opts.SizedDeallocation && - Args.hasArg(OPT_fdefine_sized_deallocation); + Opts.SizedDeallocation = Args.hasArg(OPT_fsized_deallocation); Opts.HeinousExtensions = Args.hasArg(OPT_fheinous_gnu_extensions); Opts.AccessControl = !Args.hasArg(OPT_fno_access_control); Opts.ElideConstructors = !Args.hasArg(OPT_fno_elide_constructors); Index: lib/Sema/SemaExprCXX.cpp =================================================================== --- lib/Sema/SemaExprCXX.cpp +++ lib/Sema/SemaExprCXX.cpp @@ -1704,11 +1704,31 @@ if (FD->getNumParams() == 1) return true; - return S.getLangOpts().SizedDeallocation && FD->getNumParams() == 2 && + // In C++14, the sized deallocation functions are not considered placement + // functions. + return S.getLangOpts().CPlusPlus14 && FD->getNumParams() == 2 && S.Context.hasSameUnqualifiedType(FD->getParamDecl(1)->getType(), S.Context.getSizeType()); } +static FunctionDecl *chooseSizedOrUnsizedDeallocation(const LangOptions &LO, + FunctionDecl *F1, + FunctionDecl *F2, + bool CanProvideSize) { + // We only use the sized deallocation function if we know library support is + // present, either from the user or the standard library. The user can pass + // -fsized-deallocation, or the driver can detect that the platform standard + // library supports sized deallocation. If we're not doing sized deallocation, + // we still need to filter out the sized declaration present in C++14. + assert(LO.CPlusPlus14); + unsigned NumArgs = LO.SizedDeallocation && CanProvideSize ? 2 : 1; + if (F1->getNumParams() == NumArgs) + return F1; + assert(F2->getNumParams() == NumArgs && + "found an unexpected usual deallocation function"); + return F2; +} + /// FindAllocationFunctions - Finds the overloads of operator new and delete /// that are appropriate for the allocation. bool Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range, @@ -1891,13 +1911,13 @@ // selected deallocation function shall be the one with two parameters. // Otherwise, the selected deallocation function shall be the function // with one parameter. - if (getLangOpts().SizedDeallocation && Matches.size() == 2) { - if (Matches[0].second->getNumParams() == 1) - Matches.erase(Matches.begin()); - else - Matches.erase(Matches.begin() + 1); - assert(Matches[0].second->getNumParams() == 2 && - "found an unexpected usual deallocation function"); + if (getLangOpts().CPlusPlus14 && Matches.size() == 2) { + FunctionDecl *F = chooseSizedOrUnsizedDeallocation( + getLangOpts(), Matches[0].second, Matches[1].second, + /*CanProvideSize=*/true); + if (Matches[0].second != F) + std::swap(Matches[0], Matches[1]); + Matches.resize(1); } } @@ -2118,7 +2138,10 @@ DeclareGlobalAllocationFunction( Context.DeclarationNames.getCXXOperatorName(OO_Array_Delete), Context.VoidTy, VoidPtr); - if (getLangOpts().SizedDeallocation) { + + // Implicitly declare the sized deallocation operators in C++14. CodeGen will + // not use them unless -fsized-deallocation was passed. + if (getLangOpts().CPlusPlus14) { DeclareGlobalAllocationFunction( Context.DeclarationNames.getCXXOperatorName(OO_Delete), Context.VoidTy, VoidPtr, Context.getSizeType()); @@ -2168,15 +2191,6 @@ } } } - - // If the function is sized operator delete and has not already been - // declared, and weak definitions have been disabled, do not declare - // it implicitly. Instead, let deallocation function lookup pick up - // unsized delete. - // FIXME: We should remove this guard once backward compatibility is - // no longer an issue - if (NumParams == 2 && !getLangOpts().DefineSizedDeallocation) - return; FunctionProtoType::ExtProtoInfo EPI; @@ -2255,14 +2269,11 @@ // parameter, then the selected deallocation function shall be the one // with two parameters. Otherwise, the selected deallocation function // shall be the function with one parameter. - if (getLangOpts().SizedDeallocation && Matches.size() == 2) { - unsigned NumArgs = CanProvideSize ? 2 : 1; - if (Matches[0]->getNumParams() != NumArgs) - Matches.erase(Matches.begin()); - else - Matches.erase(Matches.begin() + 1); - assert(Matches[0]->getNumParams() == NumArgs && - "found an unexpected usual deallocation function"); + if (getLangOpts().CPlusPlus14 && Matches.size() == 2) { + FunctionDecl *F = chooseSizedOrUnsizedDeallocation( + getLangOpts(), Matches[0], Matches[1], CanProvideSize); + Matches[0] = F; + Matches.resize(1); } assert(Matches.size() == 1 && Index: test/CodeGenCXX/cxx1y-sized-deallocation.cpp =================================================================== --- test/CodeGenCXX/cxx1y-sized-deallocation.cpp +++ test/CodeGenCXX/cxx1y-sized-deallocation.cpp @@ -1,22 +1,18 @@ -// RUN: %clang_cc1 -std=c++1y %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefix=CHECK-UNSIZED -// RUN: %clang_cc1 -std=c++1y %s -emit-llvm -triple x86_64-linux-gnu -o - -DINLIB | FileCheck %s --check-prefix=CHECK --check-prefix=CHECKUND -// RUN: %clang_cc1 -std=c++1y %s -emit-llvm -triple x86_64-linux-gnu -fdefine-sized-deallocation -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECKDEF -// RUN: %clang_cc1 -std=c++11 -fsized-deallocation %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefix=CHECK-UNSIZED -// RUN: %clang_cc1 -std=c++11 -fsized-deallocation %s -emit-llvm -triple x86_64-linux-gnu -o - -DINLIB | FileCheck %s --check-prefix=CHECK --check-prefix=CHECKUND -// RUN: %clang_cc1 -std=c++11 -fsized-deallocation -fdefine-sized-deallocation %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECKDEF +// Check that delete exprs call the sized deallocation function if +// -fsized-deallocation is passed. +// RUN: %clang_cc1 -std=c++14 -fsized-deallocation %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECKUND + +// Check that we don't used sized deallocation without -fsized-deallocation and +// C++14. // RUN: %clang_cc1 -std=c++11 %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefix=CHECK-UNSIZED -// RUN: %clang_cc1 -std=c++1y %s -emit-llvm -triple x86_64-linux-gnu -fno-sized-deallocation -o - | FileCheck %s --check-prefix=CHECK-UNSIZED +// RUN: %clang_cc1 -std=c++14 %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefix=CHECK-UNSIZED +// RUN: %clang_cc1 -std=c++11 -fsized-deallocation %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefix=CHECK-UNSIZED // CHECK-UNSIZED-NOT: _ZdlPvm // CHECK-UNSIZED-NOT: _ZdaPvm typedef decltype(sizeof(0)) size_t; -#ifdef INLIB -void operator delete(void *, size_t) noexcept; -void operator delete[](void *, size_t) noexcept; -#endif - typedef int A; struct B { int n; }; struct C { ~C() {} }; @@ -60,8 +56,6 @@ // CHECK: call void @_ZdlPvm(i8* %{{[^ ]*}}, i64 4) // CHECK: call void @_ZdaPv(i8* %{{[^ ]*}}) -// CHECKDEF-LABEL: define linkonce void @_ZdlPvm(i8*, i64) #{{[0-9]+}} comdat -// CHECKDEF: call void @_ZdlPv(i8* %0) // CHECKUND-LABEL: declare void @_ZdlPvm(i8* // CHECK-LABEL: define weak_odr void @_Z3delI1BEvv() @@ -82,8 +76,6 @@ // CHECK: add i64 %{{[^ ]*}}, 8 // CHECK: call void @_ZdaPvm(i8* %{{[^ ]*}}, i64 %{{[^ ]*}}) -// CHECKDEF-LABEL: define linkonce void @_ZdaPvm(i8*, i64) #{{[0-9]+}} comdat -// CHECKDEF: call void @_ZdaPv(i8* %0) // CHECKUND-LABEL: declare void @_ZdaPvm(i8* // CHECK-LABEL: define weak_odr void @_Z3delI1DEvv() Index: test/CodeGenCXX/implicit-allocation-functions.cpp =================================================================== --- test/CodeGenCXX/implicit-allocation-functions.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++11 %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK11 -// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++11 -fvisibility hidden %s 2>&1 | FileCheck %s -check-prefix=CHECKHID -check-prefix=CHECK11 -// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -DINLIB -fno-sized-deallocation %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK11 -// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -DINLIB %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK14 -check-prefix=CHECK14UND -// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -DINLIB -fvisibility hidden %s 2>&1 | FileCheck %s -check-prefix=CHECKHID -check-prefix=CHECK14 -check-prefix=CHECK14UND -// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -DINLIB -fdefine-sized-deallocation %s 2>&1 | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK14 -check-prefix=CHECK14DEFCOMDAT -// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown -o - -std=c++14 -DINLIB -fdefine-sized-deallocation -fvisibility hidden %s 2>&1 | FileCheck %s -check-prefix=CHECKHID -check-prefix=CHECK14 -check-prefix=CHECK14DEFCOMDAT -// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-macosx -o - -std=c++14 -DINLIB -fdefine-sized-deallocation %s | FileCheck %s -check-prefix=CHECKDEF -check-prefix=CHECK14 -check-prefix=CHECK14DEFNOCOMDAT - -// PR22419: Implicit sized deallocation functions always have default visibility. -// Generalized to all implicit allocation functions. - -#ifdef INLIB -typedef decltype(sizeof(0)) size_t; -void operator delete(void *, size_t) noexcept; -void operator delete[](void *, size_t) noexcept; -#endif - -// CHECK14-DAG: %struct.A = type { i8 } -struct A { }; - -// CHECKDEF-DAG: define void @_Z3fooP1A(%struct.A* %is) -// CHECKHID-DAG: define hidden void @_Z3fooP1A(%struct.A* %is) -void foo(A* is) { - - // CHECK11-DAG: call noalias i8* @_Znwm(i64 1) - // CHECK14-DAG: call noalias i8* @_Znwm(i64 1) - is = new A(); - - // CHECK11-DAG: call void @_ZdlPv(i8* %{{.+}}) - // CHECK14-DAG: call void @_ZdlPvm(i8* %{{.+}}, i64 1) - delete is; -} - -// CHECK11-DAG: declare noalias i8* @_Znwm(i64) -// CHECK11-DAG: declare void @_ZdlPv(i8*) - -// CHECK14-DAG: declare noalias i8* @_Znwm(i64) -// CHECK14UND-DAG: declare void @_ZdlPvm(i8*, i64) -// CHECK14DEFCOMDAT-DAG: define linkonce void @_ZdlPvm(i8*, i64) #{{[0-9]+}} comdat { -// CHECK14DEFCOMDAT-DAG: declare void @_ZdlPv(i8*) -// CHECK14DEFNOCOMDAT-DAG: define linkonce void @_ZdlPvm(i8*, i64) #{{[0-9]+}} { -// CHECK14DEFNOCOMDAT-DAG: declare void @_ZdlPv(i8*) - -// CHECK14-DAG: %struct.B = type { i8 } -struct B { ~B() { }}; - -// CHECKDEF-DAG: define void @_Z1fP1B(%struct.B* %p) -// CHECKHID-DAG: define hidden void @_Z1fP1B(%struct.B* %p) -void f(B *p) { - - // CHECK11-DAG: call noalias i8* @_Znam(i64 13) - // CHECK14-DAG: call noalias i8* @_Znam(i64 13) - p = new B[5]; - - // CHECK11-DAG: call void @_ZdaPv(i8* %{{.+}}) - // CHECK14-DAG: call void @_ZdaPvm(i8* %{{.+}}, i64 %{{.+}}) - delete[] p; -} - -// CHECK11-DAG: declare noalias i8* @_Znam(i64) -// CHECK11-DAG: declare void @_ZdaPv(i8*) - -// CHECK14-DAG: declare noalias i8* @_Znam(i64) -// CHECK14UND-DAG: declare void @_ZdaPvm(i8*, i64) -// CHECK14DEF-DAG: define linkonce void @_ZdaPvm(i8*, i64) #{{[0-9]+}} comdat { -// CHECK14DEF-DAG: declare void @_ZdaPv(i8*) -// CHECK14DEFNOCOMDAT-DAG: define linkonce void @_ZdaPvm(i8*, i64) #{{[0-9]+}} { -// CHECK14DEFNOCOMDAT-DAG: declare void @_ZdaPv(i8*) Index: test/CodeGenCXX/pr21754.cpp =================================================================== --- test/CodeGenCXX/pr21754.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %clang -cc1 -emit-llvm -triple x86_64-unknown-unknown -std=c++1y -o - %s 2>&1 | FileCheck %s -// RUN: %clang -cc1 -emit-llvm -triple x86_64-unknown-unknown -std=c++1y -fdefine-sized-deallocation -o - %s 2>&1 | FileCheck %s -// RUN: %clang -cc1 -emit-llvm -triple x86_64-unknown-unknown -std=c++1y -fno-sized-deallocation -o - %s 2>&1 | FileCheck %s -// RUN: %clang -cc1 -emit-llvm -triple x86_64-unknown-unknown -std=c++11 -fsized-deallocation -o - %s 2>&1 | FileCheck %s -// RUN: %clang -cc1 -emit-llvm -triple x86_64-unknown-unknown -std=c++11 -fsized-deallocation -fdefine-sized-deallocation -o - %s 2>&1 | FileCheck %s -// RUN: %clang -cc1 -emit-llvm -triple x86_64-unknown-unknown -std=c++11 -o - %s 2>&1 | FileCheck %s - -void operator delete(void*, unsigned long) throw() __attribute__((alias("foo"))); -extern "C" void foo(void*, unsigned long) {} - -// CHECK-DAG: @_ZdlPvm = alias void (i8*, i64)* @foo Index: test/Lexer/cxx-features.cpp =================================================================== --- test/Lexer/cxx-features.cpp +++ test/Lexer/cxx-features.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -std=c++98 -verify %s // RUN: %clang_cc1 -std=c++11 -verify %s -// RUN: %clang_cc1 -std=c++1y -verify %s +// RUN: %clang_cc1 -std=c++1y -fsized-deallocation -verify %s // expected-no-diagnostics