Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 3efff4a

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:0183b58e292d9d7004fabc92bd0da10eba5666db into amd-gfx:378c20547273
Local branch amd-gfx 378c205 Merged main:7a28a5b3fee6c78ad59af79a3d03c00db153c49f into amd-gfx:6434034d613e Remote branch main 0183b58 [Clang] Correctly diagnose a static function overloading a non-static function (llvm#93460)
2 parents 378c205 + 0183b58 commit 3efff4a

21 files changed

+4851
-27
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,8 @@ Bug Fixes to C++ Support
797797
in dependent contexts. Fixes (#GH92680).
798798
- Fixed a crash when diagnosing failed conversions involving template parameter
799799
packs. (#GH93076)
800+
- Fixed a regression introduced in Clang 18 causing a static function overloading a non-static function
801+
with the same parameters not to be diagnosed. (Fixes #GH93456).
800802

801803
Bug Fixes to AST Handling
802804
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/lib/AST/Interp/ByteCodeExprGen.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,6 +2672,9 @@ bool ByteCodeExprGen<Emitter>::delegate(const Expr *E) {
26722672
}
26732673

26742674
template <class Emitter> bool ByteCodeExprGen<Emitter>::visit(const Expr *E) {
2675+
if (E->getType().isNull())
2676+
return false;
2677+
26752678
if (E->getType()->isVoidType())
26762679
return this->discard(E);
26772680

clang/lib/Sema/SemaOverload.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1482,7 +1482,7 @@ static bool IsOverloadOrOverrideImpl(Sema &SemaRef, FunctionDecl *New,
14821482
}
14831483

14841484
if (OldMethod && NewMethod && !OldMethod->isStatic() &&
1485-
!OldMethod->isStatic()) {
1485+
!NewMethod->isStatic()) {
14861486
bool HaveCorrespondingObjectParameters = [&](const CXXMethodDecl *Old,
14871487
const CXXMethodDecl *New) {
14881488
auto NewObjectType = New->getFunctionObjectParameterReferenceType();

clang/test/SemaCXX/overload-decl.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,20 @@ class X {
3636

3737
int main() {} // expected-note {{previous definition is here}}
3838
int main(int,char**) {} // expected-error {{conflicting types for 'main'}}
39+
40+
41+
namespace GH93456 {
42+
43+
struct X {
44+
static void f(); // expected-note {{previous declaration is here}}
45+
void f() const;
46+
// expected-error@-1 {{static and non-static member functions with the same parameter types cannot be overloaded}}
47+
};
48+
49+
struct Y {
50+
void f() const; // expected-note {{previous declaration is here}}
51+
static void f();
52+
// expected-error@-1 {{static and non-static member functions with the same parameter types cannot be overloaded}}
53+
};
54+
55+
}

clang/test/SemaCXX/recovery-expr-type.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// RUN: %clang_cc1 -triple=x86_64-unknown-unknown -o - %s -std=gnu++17 -fsyntax-only -verify -fexperimental-new-constant-interpreter
2+
// RUN: %clang_cc1 -triple=x86_64-unknown-unknown -o - %s -std=gnu++20 -fsyntax-only -verify -fexperimental-new-constant-interpreter
13
// RUN: %clang_cc1 -triple=x86_64-unknown-unknown -o - %s -std=gnu++17 -fsyntax-only -verify
24
// RUN: %clang_cc1 -triple=x86_64-unknown-unknown -o - %s -std=gnu++20 -fsyntax-only -verify
35

llvm/include/llvm/ADT/GenericUniformityImpl.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,13 @@
4646

4747
#include "llvm/ADT/GenericUniformityInfo.h"
4848

49+
#include "llvm/ADT/DenseSet.h"
4950
#include "llvm/ADT/STLExtras.h"
5051
#include "llvm/ADT/SmallPtrSet.h"
5152
#include "llvm/ADT/SparseBitVector.h"
5253
#include "llvm/ADT/StringExtras.h"
5354
#include "llvm/Support/raw_ostream.h"
5455

55-
#include <set>
56-
5756
#define DEBUG_TYPE "uniformity"
5857

5958
namespace llvm {
@@ -413,7 +412,7 @@ template <typename ContextT> class GenericUniformityAnalysisImpl {
413412
const TargetTransformInfo *TTI = nullptr;
414413

415414
// Detected/marked divergent values.
416-
std::set<ConstValueRefT> DivergentValues;
415+
DenseSet<ConstValueRefT> DivergentValues;
417416
SmallPtrSet<const BlockT *, 32> DivergentTermBlocks;
418417

419418
// Internal worklist for divergence propagation.

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 499852
19+
#define LLVM_MAIN_REVISION 499856
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

llvm/lib/Target/AMDGPU/AMDGPUGISel.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ def : GINodeEquiv<G_AMDGPU_BUFFER_LOAD_USHORT, SIbuffer_load_ushort>;
250250
def : GINodeEquiv<G_AMDGPU_BUFFER_LOAD_UBYTE, SIbuffer_load_ubyte>;
251251
def : GINodeEquiv<G_AMDGPU_BUFFER_LOAD_SSHORT, SIbuffer_load_short>;
252252
def : GINodeEquiv<G_AMDGPU_BUFFER_LOAD_SBYTE, SIbuffer_load_byte>;
253+
def : GINodeEquiv<G_AMDGPU_BUFFER_LOAD_TFE, SIbuffer_load_tfe>;
254+
def : GINodeEquiv<G_AMDGPU_BUFFER_LOAD_USHORT_TFE, SIbuffer_load_ushort_tfe>;
255+
def : GINodeEquiv<G_AMDGPU_BUFFER_LOAD_UBYTE_TFE, SIbuffer_load_ubyte_tfe>;
256+
def : GINodeEquiv<G_AMDGPU_BUFFER_LOAD_SSHORT_TFE, SIbuffer_load_short_tfe>;
257+
def : GINodeEquiv<G_AMDGPU_BUFFER_LOAD_SBYTE_TFE, SIbuffer_load_byte_tfe>;
253258
def : GINodeEquiv<G_AMDGPU_BUFFER_LOAD_FORMAT, SIbuffer_load_format>;
254259
def : GINodeEquiv<G_AMDGPU_BUFFER_LOAD_FORMAT_TFE, SIbuffer_load_format_tfe>;
255260
def : GINodeEquiv<G_AMDGPU_BUFFER_LOAD_FORMAT_D16, SIbuffer_load_format_d16>;

llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5534,6 +5534,11 @@ const char* AMDGPUTargetLowering::getTargetNodeName(unsigned Opcode) const {
55345534
NODE_NAME_CASE(BUFFER_LOAD_USHORT)
55355535
NODE_NAME_CASE(BUFFER_LOAD_BYTE)
55365536
NODE_NAME_CASE(BUFFER_LOAD_SHORT)
5537+
NODE_NAME_CASE(BUFFER_LOAD_TFE)
5538+
NODE_NAME_CASE(BUFFER_LOAD_UBYTE_TFE)
5539+
NODE_NAME_CASE(BUFFER_LOAD_USHORT_TFE)
5540+
NODE_NAME_CASE(BUFFER_LOAD_BYTE_TFE)
5541+
NODE_NAME_CASE(BUFFER_LOAD_SHORT_TFE)
55375542
NODE_NAME_CASE(BUFFER_LOAD_FORMAT)
55385543
NODE_NAME_CASE(BUFFER_LOAD_FORMAT_TFE)
55395544
NODE_NAME_CASE(BUFFER_LOAD_FORMAT_D16)

llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,11 @@ enum NodeType : unsigned {
583583
BUFFER_LOAD_USHORT,
584584
BUFFER_LOAD_BYTE,
585585
BUFFER_LOAD_SHORT,
586+
BUFFER_LOAD_TFE,
587+
BUFFER_LOAD_UBYTE_TFE,
588+
BUFFER_LOAD_USHORT_TFE,
589+
BUFFER_LOAD_BYTE_TFE,
590+
BUFFER_LOAD_SHORT_TFE,
586591
BUFFER_LOAD_FORMAT,
587592
BUFFER_LOAD_FORMAT_TFE,
588593
BUFFER_LOAD_FORMAT_D16,

0 commit comments

Comments
 (0)