]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: avoid peeking eof after __vector
authorJiufu Guo <guojiufu@linux.ibm.com>
Mon, 9 May 2022 09:48:00 +0000 (17:48 +0800)
committerguojiufu <guojiufu@linux.ibm.com>
Tue, 10 May 2022 03:36:22 +0000 (11:36 +0800)
commit067fe66c8ba9b16feacf66fce9ae668091e42821
tree190e8892ca7c27f8e4f765d1ebb01728ae3030a7
parentbd022ff9752262a70f44b57808447f823392989e
rs6000: avoid peeking eof after __vector

There is a rare corner case: where vector is followed only by one
valid identifer and the ";" which is near the end of the file.

Like the case in PR101168:
using vdbl =  __vector double;
#define BREAK 1

For this case, "vector double" is followed by CPP_SEMICOLON and then
EOF.  There is no more tokens need to check for this case.

PR preprocessor/101168

gcc/ChangeLog:

* config/rs6000/rs6000-c.cc (rs6000_macro_to_expand):
Avoid empty identifier.

gcc/testsuite/ChangeLog:

* g++.target/powerpc/pr101168.C: New test.
gcc/config/rs6000/rs6000-c.cc
gcc/testsuite/g++.target/powerpc/pr101168.C [new file with mode: 0644]