Skip to content

Commit bf83962

Browse files
committed
fix
1 parent 6adf8a0 commit bf83962

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

tools/clang/lib/Sema/SemaHLSL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4782,7 +4782,7 @@ class HLSLExternalSource : public ExternalSemaSource {
47824782
if (type.isNull())
47834783
return false;
47844784

4785-
if (hlsl::IsPointerStringType(type))
4785+
if (hlsl::IsStringType(type) || hlsl::IsStringLiteralType(type))
47864786
return false;
47874787

47884788
if (const CXXRecordDecl *recordDecl =

tools/clang/test/HLSLFileCheckLit/hlsl/auto/auto-deducible-types.hlsl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ void main() {
2020
// Vectors.
2121
auto v = float4(1, 2, 3, 4);
2222

23+
2324
// Matrices.
2425
float2x2 matInit = { 1, 2, 3, 4 };
2526
auto m = matInit;
27+
auto row = m[0];
28+
auto elem = m[0][0];
2629

2730
// User-defined structs.
2831
MyStruct s = { 1.0f, 2 };
@@ -32,6 +35,6 @@ void main() {
3235
auto t = tex;
3336

3437
// Use every value to prevent dead-code elimination.
35-
output[0] = (float)i + f + (float)b + v.x + m._11 + sCopy.a +
38+
output[0] = (float)i + f + (float)b + v.x + m._11 + row.x + elem + sCopy.a +
3639
(float)sCopy.b + t.SampleLevel(samp, float2(0, 0), 0).x;
3740
}

0 commit comments

Comments
 (0)