[Bug preprocessor/94535] __LINE__ value changed for function-like macro invocations spanning multiple lines

2020-05-15 Thread alisdairm at me dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94535 --- Comment #13 from Alisdair Meredith --- As this has shipped for two releases now (gcc9 and 10) I recommend closing as Works As Designed, citing C standard paper N2322 as reason for the change.

[Bug preprocessor/94535] __LINE__ value changed for function-like macro invocations spanning multiple lines

2020-04-09 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94535 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment

[Bug preprocessor/94535] __LINE__ value changed for function-like macro invocations spanning multiple lines

2020-04-08 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94535 --- Comment #11 from Martin Sebor --- Fred, the author of the paper, usually tests a number of compilers. In the paper referenced from n2322 he mentions a bunch: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1911.htm

[Bug preprocessor/94535] __LINE__ value changed for function-like macro invocations spanning multiple lines

2020-04-08 Thread alisdairm at me dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94535 --- Comment #10 from Alisdair Meredith --- And double-checking the C++ Standard again, I think I have wording in favor of my report and contradicting the recommended best practice for the pending C standard: [cpp.line]p2 "The line number of the

[Bug preprocessor/94535] __LINE__ value changed for function-like macro invocations spanning multiple lines

2020-04-08 Thread alisdairm at me dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94535 --- Comment #9 from Alisdair Meredith --- (In reply to Martin Sebor from comment #7) > The following proposal was accepted into C2X last year: > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2322.htm > It seems to me like it's about the

[Bug preprocessor/94535] __LINE__ value changed for function-like macro invocations spanning multiple lines

2020-04-08 Thread alisdairm at me dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94535 --- Comment #8 from Alisdair Meredith --- (In reply to Andrew Pinski from comment #6) > Why not do this: > static_assert(X == 3 || X == 4); > > There that works for both cases. The code example was intended to the be smallest reproducible

[Bug preprocessor/94535] __LINE__ value changed for function-like macro invocations spanning multiple lines

2020-04-08 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94535 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment #7

[Bug preprocessor/94535] __LINE__ value changed for function-like macro invocations spanning multiple lines

2020-04-08 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94535 --- Comment #5 from Andrew Pinski --- Why not do this: static_assert(X == 3 || X == 4); There that works for both cases. --- Comment #6 from Andrew Pinski --- Why not do this: static_assert(X == 3 || X == 4); There that works for both cases.

[Bug preprocessor/94535] __LINE__ value changed for function-like macro invocations spanning multiple lines

2020-04-08 Thread alisdairm at me dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94535 --- Comment #4 from Alisdair Meredith --- (In reply to Andrew Pinski from comment #3) > I miss-remembered the issue, the issue was only with preprocessor directives > inside macro functions (this changed in GCC 3.3 and above really). > > But I

[Bug preprocessor/94535] __LINE__ value changed for function-like macro invocations spanning multiple lines

2020-04-08 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94535 --- Comment #3 from Andrew Pinski --- >There is no multiline "macro function" here, there is an invocation of a >macro, and the invocation spans multiple lines. I miss-remembered the issue, the issue was only with preprocessor directives