Skip to content

Commit

Permalink
Merge needed march release followups into mesh nodes (#6786)
Browse files Browse the repository at this point in the history
Merges the following changes into mesh nodes to fix a known bug that
required a point release in the march release branch and also some build
fixes for new visual studio diagnostics.

9ca52f4 Add duplicate pragma (#6732)
7809c0b Remove Windows C++ redist hack (#6692)
33277a1 Workaround broken GitHub runner images (#6683)
1b9a796 [Sema] Check FunctionDecl has identifier before getName.
(#6439) (#6457)
  • Loading branch information
pow2clk authored Jul 16, 2024
2 parents c7da630 + 9ca52f4 commit 2f29f17
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 2 additions & 0 deletions projects/dxilconv/include/ShaderBinary/ShaderBinary.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ class COperandBase {
INT64 m_Value64[2];
double m_Valued[2];
};

#pragma warning(suppress : 4201) // Warning about nameless structure.
struct {
D3D10_SB_OPERAND_INDEX_REPRESENTATION m_IndexType[3];
D3D10_SB_OPERAND_INDEX_DIMENSION m_IndexDimension;
Expand Down
3 changes: 2 additions & 1 deletion tools/clang/lib/Sema/SemaHLSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15823,7 +15823,8 @@ void TryAddShaderAttrFromTargetProfile(Sema &S, FunctionDecl *FD,

// if this FD isn't the entry point, then we shouldn't add
// a shader attribute to this decl, so just return
if (EntryPointName != FD->getIdentifier()->getName()) {
if (!FD->getIdentifier() ||
EntryPointName != FD->getIdentifier()->getName()) {
return;
}

Expand Down
32 changes: 32 additions & 0 deletions tools/clang/test/SemaHLSL/operator-overload.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// RUN: %dxc -Tps_6_0 -verify %s

// expected-error@+1 {{overloading non-member 'operator==' is not allowed}}
bool operator==(int lhs, int rhs) {
return true;
}

struct A {
float a;
int b;
};

// expected-error@+1 {{overloading non-member 'operator>' is not allowed}}
bool operator>(A a0, A a1) {
return a1.a > a0.a && a1.b > a0.b;
}
// expected-error@+1 {{overloading non-member 'operator==' is not allowed}}
bool operator==(A a0, int i) {
return a0.b == i;
}
// expected-error@+1 {{overloading non-member 'operator<' is not allowed}}
bool operator<(A a0, float f) {
return a0.a < f;
}
// expected-error@+1 {{overloading 'operator++' is not allowed}}
A operator++(A a0) {
a0.a++;
a0.b++;
return a0;
}

void main() {}

0 comments on commit 2f29f17

Please sign in to comment.