|
1 | 1 | Auto generated patch. Do not edit or delete it, even if empty.
|
2 |
| -diff -ruN --strip-trailing-cr a/libc/src/__support/FPUtil/aarch64/sqrt.h b/libc/src/__support/FPUtil/aarch64/sqrt.h |
3 |
| ---- a/libc/src/__support/FPUtil/aarch64/sqrt.h |
4 |
| -+++ b/libc/src/__support/FPUtil/aarch64/sqrt.h |
5 |
| -@@ -18,6 +18,8 @@ |
6 |
| - #error "Invalid include" |
7 |
| - #endif |
| 2 | +diff -ruN --strip-trailing-cr a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp |
| 3 | +--- a/clang/lib/Sema/SemaExprCXX.cpp |
| 4 | ++++ b/clang/lib/Sema/SemaExprCXX.cpp |
| 5 | +@@ -1929,8 +1929,9 @@ |
| 6 | + } |
| 7 | + return true; |
| 8 | + } |
| 9 | +- |
| 10 | +- return S.CheckAllocationAccess(StartLoc, Range, NamingClass, Decl, Diagnose); |
| 11 | ++ Sema::AccessResult Accessible = |
| 12 | ++ S.CheckAllocationAccess(StartLoc, Range, NamingClass, Decl, Diagnose); |
| 13 | ++ return Accessible == Sema::AR_inaccessible; |
| 14 | + } |
8 | 15 |
|
9 |
| -+#include "src/__support/FPUtil/generic/sqrt.h" |
10 |
| -+ |
11 |
| - namespace LIBC_NAMESPACE_DECL { |
12 |
| - namespace fputil { |
13 |
| - |
14 |
| -diff -ruN --strip-trailing-cr a/libc/src/__support/FPUtil/arm/sqrt.h b/libc/src/__support/FPUtil/arm/sqrt.h |
15 |
| ---- a/libc/src/__support/FPUtil/arm/sqrt.h |
16 |
| -+++ b/libc/src/__support/FPUtil/arm/sqrt.h |
17 |
| -@@ -18,6 +18,8 @@ |
18 |
| - #error "Invalid include" |
19 |
| - #endif |
| 16 | + /// Select the correct "usual" deallocation function to use from a selection of |
| 17 | +diff -ruN --strip-trailing-cr a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp |
| 18 | +--- a/clang/lib/Serialization/ASTReaderStmt.cpp |
| 19 | ++++ b/clang/lib/Serialization/ASTReaderStmt.cpp |
| 20 | +@@ -2226,10 +2226,7 @@ |
| 21 | + E->AssociatedDeclAndRef.setPointer(readDeclAs<Decl>()); |
| 22 | + E->AssociatedDeclAndRef.setInt(CurrentUnpackingBits->getNextBit()); |
| 23 | + E->Index = CurrentUnpackingBits->getNextBits(/*Width=*/12); |
| 24 | +- if (CurrentUnpackingBits->getNextBit()) |
| 25 | +- E->PackIndex = Record.readInt(); |
| 26 | +- else |
| 27 | +- E->PackIndex = 0; |
| 28 | ++ E->PackIndex = Record.readUnsignedOrNone().toInternalRepresentation(); |
| 29 | + E->Final = CurrentUnpackingBits->getNextBit(); |
| 30 | + E->SubstNonTypeTemplateParmExprBits.NameLoc = readSourceLocation(); |
| 31 | + E->Replacement = Record.readSubExpr(); |
| 32 | +@@ -2239,6 +2236,7 @@ |
| 33 | + SubstNonTypeTemplateParmPackExpr *E) { |
| 34 | + VisitExpr(E); |
| 35 | + E->AssociatedDecl = readDeclAs<Decl>(); |
| 36 | ++ E->Final = CurrentUnpackingBits->getNextBit(); |
| 37 | + E->Index = Record.readInt(); |
| 38 | + TemplateArgument ArgPack = Record.readTemplateArgument(); |
| 39 | + if (ArgPack.getKind() != TemplateArgument::Pack) |
| 40 | +diff -ruN --strip-trailing-cr a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp |
| 41 | +--- a/clang/lib/Serialization/ASTWriterStmt.cpp |
| 42 | ++++ b/clang/lib/Serialization/ASTWriterStmt.cpp |
| 43 | +@@ -2228,9 +2228,7 @@ |
| 44 | + Record.AddDeclRef(E->getAssociatedDecl()); |
| 45 | + CurrentPackingBits.addBit(E->isReferenceParameter()); |
| 46 | + CurrentPackingBits.addBits(E->getIndex(), /*Width=*/12); |
| 47 | +- CurrentPackingBits.addBit((bool)E->getPackIndex()); |
| 48 | +- if (auto PackIndex = E->getPackIndex()) |
| 49 | +- Record.push_back(*PackIndex + 1); |
| 50 | ++ Record.writeUnsignedOrNone(E->getPackIndex()); |
| 51 | + CurrentPackingBits.addBit(E->getFinal()); |
20 | 52 |
|
21 |
| -+#include "src/__support/FPUtil/generic/sqrt.h" |
| 53 | + Record.AddSourceLocation(E->getNameLoc()); |
| 54 | +@@ -2242,6 +2240,7 @@ |
| 55 | + SubstNonTypeTemplateParmPackExpr *E) { |
| 56 | + VisitExpr(E); |
| 57 | + Record.AddDeclRef(E->getAssociatedDecl()); |
| 58 | ++ CurrentPackingBits.addBit(E->getFinal()); |
| 59 | + Record.push_back(E->getIndex()); |
| 60 | + Record.AddTemplateArgument(E->getArgumentPack()); |
| 61 | + Record.AddSourceLocation(E->getParameterPackLocation()); |
| 62 | +diff -ruN --strip-trailing-cr a/clang/test/CodeGenCXX/bug135668.cpp b/clang/test/CodeGenCXX/bug135668.cpp |
| 63 | +--- a/clang/test/CodeGenCXX/bug135668.cpp |
| 64 | ++++ b/clang/test/CodeGenCXX/bug135668.cpp |
| 65 | +@@ -0,0 +1,38 @@ |
| 66 | ++// RUN: %clang_cc1 %s -triple arm64-apple-macosx -emit-llvm -fcxx-exceptions -fexceptions -std=c++23 -o - | FileCheck %s |
22 | 67 | +
|
23 |
| - namespace LIBC_NAMESPACE_DECL { |
24 |
| - namespace fputil { |
25 |
| - |
26 |
| -diff -ruN --strip-trailing-cr a/libc/src/__support/FPUtil/riscv/sqrt.h b/libc/src/__support/FPUtil/riscv/sqrt.h |
27 |
| ---- a/libc/src/__support/FPUtil/riscv/sqrt.h |
28 |
| -+++ b/libc/src/__support/FPUtil/riscv/sqrt.h |
29 |
| -@@ -18,6 +18,8 @@ |
30 |
| - #error "Invalid include" |
31 |
| - #endif |
32 |
| - |
33 |
| -+#include "src/__support/FPUtil/generic/sqrt.h" |
| 68 | ++class TestClass { |
| 69 | ++ public: |
| 70 | ++ TestClass(); |
| 71 | ++ int field = 0; |
| 72 | ++ friend class Foo; |
| 73 | ++ static void * operator new(unsigned long size); |
| 74 | ++ private: |
| 75 | ++ static void operator delete(void *p); |
| 76 | ++ }; |
34 | 77 | +
|
35 |
| - namespace LIBC_NAMESPACE_DECL { |
36 |
| - namespace fputil { |
37 |
| - |
38 |
| -diff -ruN --strip-trailing-cr a/libc/src/__support/FPUtil/x86_64/sqrt.h b/libc/src/__support/FPUtil/x86_64/sqrt.h |
39 |
| ---- a/libc/src/__support/FPUtil/x86_64/sqrt.h |
40 |
| -+++ b/libc/src/__support/FPUtil/x86_64/sqrt.h |
41 |
| -@@ -18,6 +18,8 @@ |
42 |
| - #error "sqrtss / sqrtsd need SSE2" |
43 |
| - #endif |
44 |
| - |
45 |
| -+#include "src/__support/FPUtil/generic/sqrt.h" |
| 78 | ++class Foo { |
| 79 | ++public: |
| 80 | ++ int test_method(); |
| 81 | ++}; |
46 | 82 | +
|
47 |
| - namespace LIBC_NAMESPACE_DECL { |
48 |
| - namespace fputil { |
49 |
| - |
| 83 | ++int Foo::test_method() { |
| 84 | ++ TestClass *obj = new TestClass() ; |
| 85 | ++ return obj->field; |
| 86 | ++} |
| 87 | ++ |
| 88 | ++// CHECK-LABEL: define noundef i32 @_ZN3Foo11test_methodEv |
| 89 | ++// CHECK: [[THIS_ADDR:%.*]] = alloca ptr, align 8 |
| 90 | ++// CHECK: [[OBJ:%.*]] = alloca ptr, align 8 |
| 91 | ++// CHECK: store ptr %this, ptr [[THIS_ADDR]], align 8 |
| 92 | ++// CHECK: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8 |
| 93 | ++// CHECK: [[ALLOCATION:%.*]] = call noundef ptr @_ZN9TestClassnwEm(i64 noundef 4) |
| 94 | ++// CHECK: [[INITIALIZEDOBJ:%.*]] = invoke noundef ptr @_ZN9TestClassC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ALLOCATION]]) |
| 95 | ++// CHECK-NEXT: to label %[[INVOKE_CONT:.*]] unwind label %[[LPAD:.*]] |
| 96 | ++// CHECK: [[INVOKE_CONT]]: |
| 97 | ++// CHECK: store ptr [[ALLOCATION]], ptr [[OBJ]], align 8 |
| 98 | ++// CHECK: [[OBJPTR:%.*]] = load ptr, ptr [[OBJ]], align 8 |
| 99 | ++// CHECK: [[FIELDPTR:%.*]] = getelementptr inbounds nuw %class.TestClass, ptr [[OBJPTR]], i32 0, i32 0 |
| 100 | ++// CHECK: [[FIELD:%.*]] = load i32, ptr [[FIELDPTR]], align 4 |
| 101 | ++// CHECK: ret i32 [[FIELD]] |
| 102 | ++// CHECK: [[LPAD]]: |
| 103 | ++// CHECK: call void @_ZN9TestClassdlEPv(ptr noundef [[ALLOCATION]]) #3 |
| 104 | +diff -ruN --strip-trailing-cr a/clang/test/SemaCXX/bug135668.cpp b/clang/test/SemaCXX/bug135668.cpp |
| 105 | +--- a/clang/test/SemaCXX/bug135668.cpp |
| 106 | ++++ b/clang/test/SemaCXX/bug135668.cpp |
| 107 | +@@ -0,0 +1,25 @@ |
| 108 | ++// RUN: %clang_cc1 -triple arm64-apple-macosx -Wall -fsyntax-only -verify %s -std=c++26 -fexceptions -fcxx-exceptions |
| 109 | ++// expected-no-diagnostics |
| 110 | ++ |
| 111 | ++// This test makes sure that we don't erroneously consider an accessible operator |
| 112 | ++// delete to be inaccessible, and then discard the entire new expression. |
| 113 | ++ |
| 114 | ++class TestClass { |
| 115 | ++public: |
| 116 | ++ TestClass(); |
| 117 | ++ int field = 0; |
| 118 | ++ friend class Foo; |
| 119 | ++ static void * operator new(unsigned long size); |
| 120 | ++private: |
| 121 | ++ static void operator delete(void *p); |
| 122 | ++}; |
| 123 | ++ |
| 124 | ++class Foo { |
| 125 | ++public: |
| 126 | ++ int test_method(); |
| 127 | ++}; |
| 128 | ++ |
| 129 | ++int Foo::test_method() { |
| 130 | ++ TestClass *obj = new TestClass() ; |
| 131 | ++ return obj->field; |
| 132 | ++} |
0 commit comments