Skip to content

Commit 2fcaf36

Browse files
Copilotdamyanp
andcommitted
Add template-dependent conversion operator test case
Co-authored-by: damyanp <[email protected]>
1 parent 6247898 commit 2fcaf36

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tools/clang/test/SemaHLSL/conversion-operator-errors.hlsl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,13 @@ struct AnotherStruct {
2525
return x != 0;
2626
}
2727
};
28+
29+
template<typename T>
30+
struct TemplateStruct {
31+
T value;
32+
33+
// expected-error@+1 {{conversion operator overloading is not allowed}}
34+
operator T() {
35+
return value;
36+
}
37+
};

0 commit comments

Comments
 (0)