diff options
| -rw-r--r-- | clang/docs/UsersManual.html | 4 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 5 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/operator-new.cpp | 9 |
3 files changed, 4 insertions, 14 deletions
diff --git a/clang/docs/UsersManual.html b/clang/docs/UsersManual.html index 7d6af988e17..13e02094147 100644 --- a/clang/docs/UsersManual.html +++ b/clang/docs/UsersManual.html @@ -592,8 +592,8 @@ The checks are: <dt id="opt_fno-assume-sane-operator-new"><b>-fno-assume-sane-operator-new</b>: Don't assume that the C++'s new operator is sane.</dt> -<dd>This option tells the compiler to do not assume that C++'s global - and any -possibly overloaded - new operator will always return a pointer that do not +<dd>This option tells the compiler to do not assume that C++'s global new +operator will always return a pointer that do not alias any other pointer when the function returns.</dd> <!-- ======================================================================= --> diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index ca42cac72c8..ee4bd226768 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -2799,11 +2799,6 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, D.getIdentifierLoc(), Name, R, TInfo, isStatic, isInline); - if ((Name.getCXXOverloadedOperator() == OO_New || - Name.getCXXOverloadedOperator() == OO_Array_New) && - getLangOptions().AssumeSaneOperatorNew) - NewFD->addAttr(::new (Context) MallocAttr()); - isVirtualOkay = !isStatic; } else { // Determine whether the function was written with a diff --git a/clang/test/CodeGenCXX/operator-new.cpp b/clang/test/CodeGenCXX/operator-new.cpp index 6becaae72cb..da64fc1b2d4 100644 --- a/clang/test/CodeGenCXX/operator-new.cpp +++ b/clang/test/CodeGenCXX/operator-new.cpp @@ -7,15 +7,10 @@ class teste { int A; teste() : A(2) {} - void* operator new(unsigned) {return ::new teste();} }; void f1() { + // CHECK-SANE: declare noalias i8* @_Znwj( + // CHECK-SANENOT: declare i8* @_Znwj( new teste(); } - -// CHECK-SANE: define linkonce_odr noalias i8* @_ZN5testenwEj( -// CHECK-SANE: declare noalias i8* @_Znwj( - -// CHECK-SANENOT: define linkonce_odr i8* @_ZN5testenwEj( -// CHECK-SANENOT: declare i8* @_Znwj( |

