diff options
author | Neil Booth <neil@daikokuya.co.uk> | 2002-11-08 22:36:22 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2002-11-08 22:36:22 +0000 |
commit | a4b1e6535fbb88329a7ab2073cb49465560c2573 (patch) | |
tree | 53ffba0617dfe5e5a3b6a9168bdf1e4d0f371d3d /gcc/cpptrad.c | |
parent | e6e8c77230468e239ece1a0254781b9392fca797 (diff) | |
download | gcc-a4b1e6535fbb88329a7ab2073cb49465560c2573.zip gcc-a4b1e6535fbb88329a7ab2073cb49465560c2573.tar.gz gcc-a4b1e6535fbb88329a7ab2073cb49465560c2573.tar.bz2 |
re PR preprocessor/8497 (traditional preprocessor #if/#endif bug)
PR preprocessor/8497
PR preprocessor/8501
* cpptrad.c (scan_out_logical_line): A '#' from a macro doesn't
start a directive. In assembler, #NUM is not a line directive.
From-SVN: r58938
Diffstat (limited to 'gcc/cpptrad.c')
-rw-r--r-- | gcc/cpptrad.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cpptrad.c b/gcc/cpptrad.c index 51b0bfc..902ae49 100644 --- a/gcc/cpptrad.c +++ b/gcc/cpptrad.c @@ -682,7 +682,10 @@ scan_out_logical_line (pfile, macro) break; case '#': - if (out - 1 == pfile->out.base && !pfile->state.in_directive) + if (out - 1 == pfile->out.base + /* A '#' from a macro doesn't start a directive. */ + && !pfile->context->prev + && !pfile->state.in_directive) { /* A directive. With the way _cpp_handle_directive currently works, we only want to call it if either we @@ -705,7 +708,8 @@ scan_out_logical_line (pfile, macro) { bool do_it = false; - if (is_numstart (*cur)) + if (is_numstart (*cur) + && CPP_OPTION (pfile, lang) != CLK_ASM) do_it = true; else if (is_idstart (*cur)) /* Check whether we know this directive, but don't |