yum-mirror/slang

Making it easier to work with shaders

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

Tim FoleySome ad hoc parser fixes (#1723)4bf01b04c

master
620 B20 linesraw
1// incomplete-member-decl.slang
2
3//DIAGNOSTIC_TEST:SIMPLE:
4
5// Regresion test to ensure parser doesn't go into infinite loop
6// on incomplete/malformed member decalration
7
8struct Outer
9{
10    // Programmer was *trying* to declarae a field, but somehow
11    // ended up with two type specifiers.
12    //
13    // Parser sees the second (generic) type specifier and assumes
14    // it must represent a method declaration, at which point it
15    // fails to find a parameter list (no opening `(`), and then
16    // fails to find a body (no opening `{`), but finds a bare identifier
17    // instead.
18    //
19    int MyType<X> inner;
20}