PP: More clearly distinguish funtion-like and object-like macros

This commit is contained in:
John Kessenich
2018-11-07 17:14:46 -07:00
parent 0a339ec20c
commit 4ee2f75294
4 changed files with 17 additions and 15 deletions

View File

@@ -35,9 +35,9 @@ ERROR: 0:155: '#else' : unexpected tokens following directive
ERROR: 0:158: '#else' : #else after #else
ERROR: 0:160: '#endif' : unexpected tokens following directive
ERROR: 0:164: '#define' : duplicate macro parameter
ERROR: 0:173: '#define' : Macro redefined; different number of arguments: m4
ERROR: 0:178: '#define' : Macro redefined; different number of arguments: m5
ERROR: 0:182: '#define' : Macro redefined; different number of arguments: m6
ERROR: 0:173: '#define' : Macro redefined; function-like versus object-like: m4
ERROR: 0:177: '#define' : Macro redefined; function-like versus object-like: m5
ERROR: 0:181: '#define' : Macro redefined; different number of arguments: m6
ERROR: 0:185: '#define' : Macro redefined; different substitutions: m7
ERROR: 0:192: '#define' : Macro redefined; different substitutions: m8
ERROR: 0:196: '#define' : Macro redefined; different argument names: m9

4
Test/cppSimple.vert Normal file → Executable file
View File

@@ -170,7 +170,7 @@ int a = length("aoenatuh"); // ERROR
// ERROR
#define m4(b)
#define m4 (b)
#define m4
// ERROR
#define m5 (b)
@@ -178,7 +178,7 @@ int a = length("aoenatuh"); // ERROR
// ERROR
#define m6(a)
#define m6
#define m6(a,b)
// ERROR (whitespace)
#define m7 (a)