cor3ntin wrote:
@offsetof Do you need us to merge that for you?
https://github.com/llvm/llvm-project/pull/132285
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: None (offsetof)
Changes
Fix access and ambiguity checks not being performed when converting to an
rvalue reference to a base class type with `static_cast`.
Fixes #121429
---
Full diff: https://github.com/llvm/llvm-project/pull/132285.dif
@@ -23,3 +22,66 @@ void test(A &a, B &b) {
const A &&ar10 = static_cast(xvalue());
const A &&ar11 = static_cast(xvalue());
}
+
+struct C : private A { // expected-note 4 {{declared private here}}
offsetof wrote:
Added a namespace.
https://github.com/llvm/
@@ -1572,13 +1571,12 @@ TryCastResult TryLValueToRValueCast(Sema &Self, Expr
*SrcExpr,
if (RefConv & Sema::ReferenceConversions::DerivedToBase) {
Kind = CK_DerivedToBase;
-CXXBasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/true,
- /*D
https://github.com/offsetof updated
https://github.com/llvm/llvm-project/pull/132285
>From ac82e33db6879a8657706129fb28f3565e1899ba Mon Sep 17 00:00:00 2001
From: offsetof
Date: Thu, 20 Mar 2025 20:54:58 +
Subject: [PATCH 1/3] [clang] Fix static_cast bypassing access control
Fix access and
@@ -1572,13 +1571,12 @@ TryCastResult TryLValueToRValueCast(Sema &Self, Expr
*SrcExpr,
if (RefConv & Sema::ReferenceConversions::DerivedToBase) {
Kind = CK_DerivedToBase;
-CXXBasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/true,
- /*D
@@ -1572,13 +1571,12 @@ TryCastResult TryLValueToRValueCast(Sema &Self, Expr
*SrcExpr,
if (RefConv & Sema::ReferenceConversions::DerivedToBase) {
Kind = CK_DerivedToBase;
-CXXBasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/true,
- /*D
@@ -1572,13 +1571,12 @@ TryCastResult TryLValueToRValueCast(Sema &Self, Expr
*SrcExpr,
if (RefConv & Sema::ReferenceConversions::DerivedToBase) {
Kind = CK_DerivedToBase;
-CXXBasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/true,
- /*D
@@ -23,3 +22,66 @@ void test(A &a, B &b) {
const A &&ar10 = static_cast(xvalue());
const A &&ar11 = static_cast(xvalue());
}
+
+struct C : private A { // expected-note 4 {{declared private here}}
shafik wrote:
Normally when we add tests to an existing file
https://github.com/Sirraide approved this pull request.
https://github.com/llvm/llvm-project/pull/132285
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/offsetof created
https://github.com/llvm/llvm-project/pull/132285
Fix access and ambiguity checks not being performed when converting to an
rvalue reference to a base class type with `static_cast`.
Fixes #121429
>From ac82e33db6879a8657706129fb28f3565e1899ba Mon Sep 17 00:0
@@ -23,3 +22,67 @@ void test(A &a, B &b) {
const A &&ar10 = static_cast(xvalue());
const A &&ar11 = static_cast(xvalue());
}
+
+struct C : private A { // expected-note 4 {{declared private here}}
+C&& that();
+
+void f() {
+(void)static_cast(*this);
+
https://github.com/offsetof updated
https://github.com/llvm/llvm-project/pull/132285
>From ac82e33db6879a8657706129fb28f3565e1899ba Mon Sep 17 00:00:00 2001
From: offsetof
Date: Thu, 20 Mar 2025 20:54:58 +
Subject: [PATCH 1/2] [clang] Fix static_cast bypassing access control
Fix access and
@@ -23,3 +22,67 @@ void test(A &a, B &b) {
const A &&ar10 = static_cast(xvalue());
const A &&ar11 = static_cast(xvalue());
}
+
+struct C : private A { // expected-note 4 {{declared private here}}
+C&& that();
+
+void f() {
+(void)static_cast(*this);
+
@@ -23,3 +22,67 @@ void test(A &a, B &b) {
const A &&ar10 = static_cast(xvalue());
const A &&ar11 = static_cast(xvalue());
}
+
+struct C : private A { // expected-note 4 {{declared private here}}
+C&& that();
+
+void f() {
+(void)static_cast(*this);
+
https://github.com/Sirraide edited
https://github.com/llvm/llvm-project/pull/132285
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Sirraide commented:
Fix overall looks fine.
https://github.com/llvm/llvm-project/pull/132285
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
17 matches
Mail list logo