yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

kaizhangNVFix a bug in default ctor synthesizing (#6527)e1952dc8c

master
459 B22 linesraw
1//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
2
3struct ExplicitCtor
4{
5   int x;
6   int y;
7   __init(int x)
8   {
9      this.x = x;
10      this.y = 0;
11   }
12  // compiler does not synthesize any ctors.
13}
14
15void test()
16{
17   // CHECK: error 39999: too many arguments to call (got 2, expected 1)
18   ExplicitCtor e = {1, 2}; // error, no ctor matches initializer list.
19
20   // CHECK: error 39999: not enough arguments to call (got 0, expected 1)
21   ExplicitCtor e1 = {};
22}