Fix issue #708: token pasting within macro argument expansion.

This commit is contained in:
John Kessenich
2017-02-10 10:04:16 -07:00
parent 0793988697
commit 8e711b84bd
5 changed files with 41 additions and 22 deletions

View File

@@ -63,6 +63,8 @@ ERROR: node is still EOpNull!
0:? 4 (const int)
0:? 'cop' (global int)
0:? 'dop' (global bool)
0:? 'argPaste2' (uniform int)
0:? 'argPaste20suff' (uniform int)
0:? 'gl_VertexID' (gl_VertexId int VertexId)
0:? 'gl_InstanceID' (gl_InstanceId int InstanceId)
@@ -107,6 +109,8 @@ ERROR: node is still EOpNull!
0:? 4 (const int)
0:? 'cop' (global int)
0:? 'dop' (global bool)
0:? 'argPaste2' (uniform int)
0:? 'argPaste20suff' (uniform int)
0:? 'gl_VertexID' (gl_VertexId int VertexId)
0:? 'gl_InstanceID' (gl_InstanceId int InstanceId)

View File

@@ -68,3 +68,12 @@ void foo()
// recovery from bad op
bool f = e MAKE_OP(>,!) 5;
}
// arguments: should make 'uniform int argPaste2;'
#define M_NEST(q) int q
#define M_OUTER(p) M_NEST(p##2)
uniform M_OUTER(argPaste);
// should make 'uniform int argPaste20suff;'
#define M_NEST2(q) int q ## suff
#define M_OUTER2(p) M_NEST2(p ## 20)
uniform M_OUTER2(argPaste);