Skip to content

Commit 2f29f17

Browse files
author
Greg Roth
authored
Merge needed march release followups into mesh nodes (#6786)
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)
2 parents c7da630 + 9ca52f4 commit 2f29f17

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

projects/dxilconv/include/ShaderBinary/ShaderBinary.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,8 @@ class COperandBase {
378378
INT64 m_Value64[2];
379379
double m_Valued[2];
380380
};
381+
382+
#pragma warning(suppress : 4201) // Warning about nameless structure.
381383
struct {
382384
D3D10_SB_OPERAND_INDEX_REPRESENTATION m_IndexType[3];
383385
D3D10_SB_OPERAND_INDEX_DIMENSION m_IndexDimension;

tools/clang/lib/Sema/SemaHLSL.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15823,7 +15823,8 @@ void TryAddShaderAttrFromTargetProfile(Sema &S, FunctionDecl *FD,
1582315823

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// RUN: %dxc -Tps_6_0 -verify %s
2+
3+
// expected-error@+1 {{overloading non-member 'operator==' is not allowed}}
4+
bool operator==(int lhs, int rhs) {
5+
return true;
6+
}
7+
8+
struct A {
9+
float a;
10+
int b;
11+
};
12+
13+
// expected-error@+1 {{overloading non-member 'operator>' is not allowed}}
14+
bool operator>(A a0, A a1) {
15+
return a1.a > a0.a && a1.b > a0.b;
16+
}
17+
// expected-error@+1 {{overloading non-member 'operator==' is not allowed}}
18+
bool operator==(A a0, int i) {
19+
return a0.b == i;
20+
}
21+
// expected-error@+1 {{overloading non-member 'operator<' is not allowed}}
22+
bool operator<(A a0, float f) {
23+
return a0.a < f;
24+
}
25+
// expected-error@+1 {{overloading 'operator++' is not allowed}}
26+
A operator++(A a0) {
27+
a0.a++;
28+
a0.b++;
29+
return a0;
30+
}
31+
32+
void main() {}

0 commit comments

Comments
 (0)