Bogus __has_include handling
diff mbox series

Message ID f312bef9-b866-9b63-6798-dfe3953381db@acm.org
State New
Headers show
Series
  • Bogus __has_include handling
Related show

Commit Message

Nathan Sidwell Jan. 24, 2020, 12:22 p.m. UTC
I noticed, but ignored this code when addressing p80005, but having
fixed up defined(X) on the modules branch, I could see where it came
from, and it's obviously wrong as we've just pulled out a string
contant from the token.

pushed to trunk.

nathan

Patch
diff mbox series

2020-01-24  Nathan Sidwell  <nathan@acm.org>

	* expr.c (parse_has_include): Remove bogus controlling macro code.

diff --git i/libcpp/expr.c w/libcpp/expr.c
index df21a4b9fb9..6c56803e3b0 100644
--- i/libcpp/expr.c
+++ w/libcpp/expr.c
@@ -2211,14 +2211,12 @@  parse_has_include (cpp_reader *pfile, cpp_hashnode *op, include_type type)
   pfile->state.angled_headers = false;
 
   bool bracket = token->type != CPP_STRING;
-  cpp_hashnode *node = NULL;
   char *fname = NULL;
   if (token->type == CPP_STRING || token->type == CPP_HEADER_NAME)
     {
       fname = XNEWVEC (char, token->val.str.len - 1);
       memcpy (fname, token->val.str.text + 1, token->val.str.len - 2);
       fname[token->val.str.len - 2] = '\0';
-      node = token->val.node.node;
     }
   else if (token->type == CPP_LESS)
     fname = _cpp_bracket_include (pfile);
@@ -2241,8 +2239,5 @@  parse_has_include (cpp_reader *pfile, cpp_hashnode *op, include_type type)
     cpp_error (pfile, CPP_DL_ERROR,
 	       "missing ')' after \"%s\" operand", NODE_NAME (op));
 
-  if (node)
-    pfile->mi_ind_cmacro = node;
-
   return result;
 }