summaryrefslogtreecommitdiff
path: root/tests/diagnostics/bad-operator-call.slang
blob: 1455d1cc3fa1a0efcd675a29c57c2b70ab1443c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// bad-operator-call.slang

//DIAGNOSTIC_TEST(windows):SIMPLE:

// Test that bad calls to operators produce reasonable diagnostic messages.

// Note: This test is currently Windows-only becase our Linux builds
// seem to print references to the stdlib code with paths that don't
// match the Windows build (which generated our baseline).

struct S {}

void test()
{
	int a;
	S b;

	a += b;

	a = a + b;

	a = ~b;

	vector<int, 4> c;
	vector<float, 3> d;

	a += c;

	c = a + c;

	d += c;

	d = c + d;
}