re PR preprocessor/45457 (ICE: invalid built-in macro "__DBL_DENORM_MIN__")

PR preprocessor/45457
	* expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
	needed.
	* directives.c (do_ifdef, do_ifndef): Likewise.

	* c-c++-common/cpp/pr45457.c: New test.

From-SVN: r163705
This commit is contained in:
Jakub Jelinek 2010-09-01 00:47:25 +02:00 committed by Jakub Jelinek
parent 0c1bebc414
commit a69d2520e0
5 changed files with 40 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2010-08-31 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/45457
* c-c++-common/cpp/pr45457.c: New test.
2010-08-31 Eric Botcazou <ebotcazou@adacore.com> 2010-08-31 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/nested-func-8.c: New test. * gcc.dg/nested-func-8.c: New test.

View File

@ -0,0 +1,18 @@
/* PR preprocessor/45457 */
/* { dg-do compile } */
const char *a =
#ifdef __DBL_DENORM_MIN__
"a"
#endif
#if defined(__DBL_EPSILON__)
"b"
#endif
#ifndef __DBL_MAX__
"c"
#endif
#if !defined(__DBL_MIN__)
"d"
#endif
;
double b = __DBL_DENORM_MIN__ + __DBL_EPSILON__ + __DBL_MAX__ + __DBL_MIN__;

View File

@ -1,3 +1,10 @@
2010-08-31 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/45457
* expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
needed.
* directives.c (do_ifdef, do_ifndef): Likewise.
2010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* system.h [HAVE_INTTYPES_H]: Include inttypes.h. * system.h [HAVE_INTTYPES_H]: Include inttypes.h.

View File

@ -1,7 +1,7 @@
/* CPP Library. (Directive handling.) /* CPP Library. (Directive handling.)
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2007, 2008, 2009 Free Software Foundation, Inc. 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Contributed by Per Bothner, 1994-95. Contributed by Per Bothner, 1994-95.
Based on CCCP program by Paul Rubin, June 1986 Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987 Adapted to ANSI C, Richard Stallman, Jan 1987
@ -1804,6 +1804,9 @@ do_ifdef (cpp_reader *pfile)
node->flags |= NODE_USED; node->flags |= NODE_USED;
if (node->type == NT_MACRO) if (node->type == NT_MACRO)
{ {
if ((node->flags & NODE_BUILTIN)
&& pfile->cb.user_builtin_macro)
pfile->cb.user_builtin_macro (pfile, node);
if (pfile->cb.used_define) if (pfile->cb.used_define)
pfile->cb.used_define (pfile, pfile->directive_line, node); pfile->cb.used_define (pfile, pfile->directive_line, node);
} }
@ -1842,6 +1845,9 @@ do_ifndef (cpp_reader *pfile)
node->flags |= NODE_USED; node->flags |= NODE_USED;
if (node->type == NT_MACRO) if (node->type == NT_MACRO)
{ {
if ((node->flags & NODE_BUILTIN)
&& pfile->cb.user_builtin_macro)
pfile->cb.user_builtin_macro (pfile, node);
if (pfile->cb.used_define) if (pfile->cb.used_define)
pfile->cb.used_define (pfile, pfile->directive_line, node); pfile->cb.used_define (pfile, pfile->directive_line, node);
} }

View File

@ -700,6 +700,9 @@ parse_defined (cpp_reader *pfile)
node->flags |= NODE_USED; node->flags |= NODE_USED;
if (node->type == NT_MACRO) if (node->type == NT_MACRO)
{ {
if ((node->flags & NODE_BUILTIN)
&& pfile->cb.user_builtin_macro)
pfile->cb.user_builtin_macro (pfile, node);
if (pfile->cb.used_define) if (pfile->cb.used_define)
pfile->cb.used_define (pfile, pfile->directive_line, node); pfile->cb.used_define (pfile, pfile->directive_line, node);
} }