2011-06-08 Lawrence Crowl <crowl@google.com>
* g++.dg/pph/c120060625-1.h: Make expected pass.
* g++.dg/pph/c120060625-1.cc: Make expected pass.
2011-06-08 Lawrence Crowl <crowl@google.com>
* symtab.c (lt_query_macro): Querying "user builtin" macros should not
call _cpp_builtin_macro_text. Instead, call regular query, but first
let the front end define the value.
===================================================================
@@ -1,5 +1 @@
-// { dg-xfail-if "ICE" { "*-*-*" } { "-fpph-map=pph.map" } }
-// { dg-bogus "c120060625-1.h:14:22: internal compiler error: invalid built-in macro .__FLT_MAX__." "" { xfail *-*-* } 0 }
-// { dg-prune-output "In file included from " }
-
#include "c120060625-1.h"
===================================================================
@@ -1,6 +1,3 @@
-// { dg-xfail-if "ICE" { "*-*-*" } { "-fpph-map=pph.map" } }
-// { dg-bogus "c120060625-1.h:14:22: internal compiler error: invalid built-in macro .__FLT_MAX__." "" { xfail *-*-* } 0 }
-
#ifndef __PPH_GUARD_H
#define __PPH_GUARD_H
===================================================================
@@ -494,7 +494,8 @@ static const char *
lt_query_macro (cpp_reader *reader, cpp_hashnode *cpp_node)
{
const char *definition = NULL;
- if (cpp_node->flags & NODE_BUILTIN)
+ if ((cpp_node->flags & NODE_BUILTIN)
+ && cpp_node->value.builtin < BT_FIRST_USER)
{
const char *str = (const char *)cpp_node->ident.str;
if ( strcmp(str, "__DATE__") == 0
@@ -527,6 +528,8 @@ lt_query_macro (cpp_reader *reader, cpp_
else
{
char c;
+ if ((cpp_node->flags & NODE_BUILTIN) && reader->cb.user_builtin_macro)
+ reader->cb.user_builtin_macro (reader, cpp_node);
definition = (const char *) cpp_macro_definition (reader, cpp_node);
/* Skip over the macro name within the definition. */
c = *definition;