public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* handling of TAB in column number
@ 2009-11-15 13:12 Arnaud Charlet
  2009-11-15 17:25 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaud Charlet @ 2009-11-15 13:12 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gcc

Hi,

Back in 2009-12-15, you wrote an interesting patch to take into account
TAB chars and compute column numbers according to GNU standard in GCC:

http://gcc.gnu.org/ml/gcc-patches/2008-12/msg00880.html

I see that this patch is not present in either trunk or in the
diagnostics-branch.

Could you explain what is the status of this patch? Has it been decided to
drop it? If so, for which reason?

If not, is there anything blocking to apply it at this stage?

Thanks in advance,

Arno

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: handling of TAB in column number
  2009-11-15 13:12 handling of TAB in column number Arnaud Charlet
@ 2009-11-15 17:25 ` Tom Tromey
  2009-11-15 17:34   ` Arnaud Charlet
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2009-11-15 17:25 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: gcc

>>>>> "Arnaud" == Arnaud Charlet <charlet@adacore.com> writes:

Arnaud> Back in 2009-12-15, you wrote an interesting patch to take into
Arnaud> account TAB chars and compute column numbers according to GNU
Arnaud> standard in GCC:
Arnaud> http://gcc.gnu.org/ml/gcc-patches/2008-12/msg00880.html
Arnaud> I see that this patch is not present in either trunk or in the
Arnaud> diagnostics-branch.

Arnaud> Could you explain what is the status of this patch? Has it been
Arnaud> decided to drop it? If so, for which reason?

Arnaud> If not, is there anything blocking to apply it at this stage?

I never ran the patch through the test suite.  I assume it would require
some test suite changes.

Also, I've experimented more with Aldy's location improvement patch
(which is now on mainline, I think diagnostics-branch is closed), and
Emacs (I used Emacs 23 for my experiment -- automated code rewriting
using gcc error messages to decide where to edit) agrees with what GCC
generates now.  So, changing this might actually be the wrong thing to
do now.


If you're interested in locations, I have a couple other unfinished
location patches that could use some attention.  One is an attempt to
fix all the errors in libcpp to use the correct location.  The other is
a patch to include macro expansion information in a location_t.

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: handling of TAB in column number
  2009-11-15 17:25 ` Tom Tromey
@ 2009-11-15 17:34   ` Arnaud Charlet
  2009-11-15 17:59     ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaud Charlet @ 2009-11-15 17:34 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gcc, Arnaud Charlet

> I never ran the patch through the test suite.  I assume it would require
> some test suite changes.

OK, I can do that and see where things are.

> Also, I've experimented more with Aldy's location improvement patch
> (which is now on mainline, I think diagnostics-branch is closed), and
> Emacs (I used Emacs 23 for my experiment -- automated code rewriting
> using gcc error messages to decide where to edit) agrees with what GCC
> generates now.  So, changing this might actually be the wrong thing to
> do now.

Well, I guess it's a chicken and egg problem: Emacs might have been modified
to follow whatever GCC is outputting right now (even though it's not following
GNU standard).

Since the addition of columns and in particular enabling of columns by default
is pretty recent, I think it still makes sense to make this change, otherwise
later might indeed be too late.

Alternatively we could have an option, but that would be overkill IMO.

> If you're interested in locations, I have a couple other unfinished
> location patches that could use some attention.  One is an attempt to
> fix all the errors in libcpp to use the correct location.  The other is
> a patch to include macro expansion information in a location_t.

I'm working on generating cross-ref info from GCC for C/C++ sources.
So I'm not too interested directly in error location (your first patch above),
but the second patch you mention might be of interest indeed, can you please
send it to me? I'm not sure I understand what 'include macro expansion
info in a location_t' means exactly, so I'm curious.

Also, what about column info in libcpp itself, in particular when handling
macros? It seems that when e.g. the define() or used_define() callbacks are
called, the only useful sloc info stored in input_location (itself kind
of deprecated as I understand it) is the current line, with column 0.
Might actually be related to your first patch mentioned above?

Arno

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: handling of TAB in column number
  2009-11-15 17:34   ` Arnaud Charlet
@ 2009-11-15 17:59     ` Tom Tromey
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2009-11-15 17:59 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: gcc

[-- Attachment #1: Type: text/plain, Size: 2296 bytes --]

>>>>> "Arnaud" == Arnaud Charlet <charlet@adacore.com> writes:

Arnaud> Alternatively we could have an option, but that would be overkill IMO.

Yeah.  It is a mess :-(

Tom> If you're interested in locations, I have a couple other unfinished
Tom> location patches that could use some attention.  One is an attempt to
Tom> fix all the errors in libcpp to use the correct location.  The other is
Tom> a patch to include macro expansion information in a location_t.

Arnaud> I'm working on generating cross-ref info from GCC for C/C++
Arnaud> sources.  So I'm not too interested directly in error location
Arnaud> (your first patch above), but the second patch you mention might
Arnaud> be of interest indeed, can you please send it to me? I'm not
Arnaud> sure I understand what 'include macro expansion info in a
Arnaud> location_t' means exactly, so I'm curious.

Arnaud> Also, what about column info in libcpp itself, in particular
Arnaud> when handling macros? It seems that when e.g. the define() or
Arnaud> used_define() callbacks are called, the only useful sloc info
Arnaud> stored in input_location (itself kind of deprecated as I
Arnaud> understand it) is the current line, with column 0.  Might
Arnaud> actually be related to your first patch mentioned above?

I've attached both patches.

I wrote the error location one long enough ago that I don't really
remember what exactly it does.  It does seem to improve locations in
libcpp in ways not directly affecting error output, so it might be
useful.

What "include macro expansion info in a location_t" means is that a
token arising from macro expansion carries two locations, one indicating
the logical source location (where the expansion occurred) and one
indicating the token's "physical" location (where the macro was defined,
or the location of a token in an actual argument).  My goal here is to
have GCC emit error messages that track macro expansion, in an attempt
to expose better information to users.  (Later I thought of a possible
secondary goal: to let users debug into very large macros like those
appearing in GCC.  However, I have made no attempt at implementing
this.)

Both of these patches are fairly buggy.  I hope to get to them again
someday, but... yeah.  Feel free to take whatever you can use from them.

Tom


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: libcpp error patch --]
[-- Type: text/x-patch, Size: 137616 bytes --]

Index: gcc/testsuite/gcc.dg/cpp/if-4.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/if-4.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/if-4.c	(working copy)
@@ -2,7 +2,7 @@
    NUL terminated, so we would print garbage after it.  */
 /* { dg-do compile } */
 
-#if 1 += 2   /* { dg-error "is not valid" "+= in if" } */
+#if 1 += 2   /* { dg-error "7:is not valid" "+= in if" } */
 syntax_error
 #endif
 int foo;
Index: gcc/testsuite/gcc.dg/cpp/redef3.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/redef3.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/redef3.c	(working copy)
@@ -11,11 +11,11 @@
 #define D 1 2
 #define E
 
-/* { dg-warning "redefined" "redef A"      { target *-*-* } 7  }
-   { dg-warning "redefined" "redef B"      { target *-*-* } 9  }
-   { dg-warning "redefined" "redef D"      { target *-*-* } 11 }
-   { dg-warning "redefined" "redef E"      { target *-*-* } 12 }
-   { dg-warning "previous"  "prev def A"   { target *-*-* } 6  }
-   { dg-warning "previous"  "prev def B"   { target *-*-* } 8  }
+/* { dg-warning "9:redefined" "redef A"      { target *-*-* } 7  }
+   { dg-warning "9:redefined" "redef B"      { target *-*-* } 9  }
+   { dg-warning "9:redefined" "redef D"      { target *-*-* } 11 }
+   { dg-warning "9:redefined" "redef E"      { target *-*-* } 12 }
+   { dg-warning "9:previous"  "prev def A"   { target *-*-* } 6  }
+   { dg-warning "9:previous"  "prev def B"   { target *-*-* } 8  }
    { dg-warning "previous"  "prev def D/E" { target *-*-* } 0  }
 */
Index: gcc/testsuite/gcc.dg/cpp/unc4.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/unc4.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/unc4.c	(working copy)
@@ -1,17 +1,16 @@
 /* { dg-do preprocess } */
-/* { dg-options "-fno-show-column" } */
 
 /* Tests for un-terminated conditional diagnostics.
-   Copyright (c) 1999 Free Software Foundation.
+   Copyright (c) 1999, 2008 Free Software Foundation.
    Contributed by Zack Weinberg, who made it up all by himself.  */
 
-#endif /* { dg-error "#endif" "#endif without #if" } */
+#endif /* { dg-error "2:#endif" "#endif without #if" } */
 
-#else  /* { dg-error "#else" "#else without #if" } */
-#endif /* { dg-error "#endif" "#endif after #else without #if" } */
+#else  /* { dg-error "2:#else" "#else without #if" } */
+#endif /* { dg-error "2:#endif" "#endif after #else without #if" } */
 
-#elif 0 /* { dg-error "#elif" "#elif without #if" } */
-#endif  /* { dg-error "#endif" "#endif after #else without #if" } */
+#elif 0 /* { dg-error "2:#elif" "#elif without #if" } */
+#endif  /* { dg-error "2:#endif" "#endif after #else without #if" } */
 
 #if 1  /* { dg-bogus "unterminated" "terminated true conditional" } */
 blah
@@ -37,4 +36,4 @@
 
 /* dg.exp doesn't read the included files for tags, so we have to
    do them explicitly here.  */
-/* { dg-error "#if" "unc1.c: unterminated #if" { target *-*-* } 4 } */
+/* { dg-error "1:#if" "unc1.c: unterminated #if" { target *-*-* } 4 } */
Index: gcc/testsuite/gcc.dg/cpp/mac-dir-2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/mac-dir-2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/mac-dir-2.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.  */
+/* Copyright (C) 2002, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 
@@ -11,6 +11,6 @@
 #define f(x) x
 
 f (
-#if 1		/* { dg-error "not portable" } */
+#if 1		/* { dg-error "1:not portable" } */
 1)
 #endif
Index: gcc/testsuite/gcc.dg/cpp/tr-warn3.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/tr-warn3.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/tr-warn3.c	(working copy)
@@ -3,7 +3,7 @@
    warnings inside unused clauses because they are often hidden this
    way on purpose.  However they do still require indentation for K&R.  */
 /* { dg-do preprocess } */
-/* { dg-options "-pedantic -Wtraditional -fno-show-column" } */
+/* { dg-options "-pedantic -Wtraditional" } */
 
 #if 1
 
@@ -11,21 +11,21 @@
 
 #define foo bar		/* { dg-bogus "indented" "^#kandr"     } */
 # define foo bar	/* { dg-bogus "indented" "^# kandr"    } */
- #define foo bar	/* { dg-warning "indented" "^ #kandr"  } */
- # define foo bar	/* { dg-warning "indented" "^ # kandr" } */
+ #define foo bar	/* { dg-warning "2:indented" "^ #kandr"  } */
+ # define foo bar	/* { dg-warning "2:indented" "^ # kandr" } */
 
 /* Block 2: C89 directives should not have the # indented to warn.  */
 
-#pragma whatever	/* { dg-warning "indented" "^#c89"     } */
-# pragma whatever	/* { dg-warning "indented" "^# c89"    } */
+#pragma whatever	/* { dg-warning "1:indented" "^#c89"     } */
+# pragma whatever	/* { dg-warning "1:indented" "^# c89"    } */
  #pragma whatever	/* { dg-bogus "indented" "^ #c89"      } */
  # pragma whatever	/* { dg-bogus "indented" "^ # c89"     } */
 
 /* Block 3: Extensions should not have the # indented to warn, _and_
    they should get a -pedantic warning. */
 
-#assert foo(bar)	/* { dg-warning "indented" "^#ext"    } */
-# assert bar(baz)	/* { dg-warning "indented" "^# ext"   } */
+#assert foo(bar)	/* { dg-warning "1:indented" "^#ext"    } */
+# assert bar(baz)	/* { dg-warning "1:indented" "^# ext"   } */
  #assert baz(quux)	/* { dg-bogus "indented" "^ #ext"     } */
  # assert quux(weeble)	/* { dg-bogus "indented" "^ # ext"    } */
 
@@ -35,21 +35,21 @@
 
 #undef foo bar		/* { dg-bogus "indented" "^#kandr"     } */
 # undef foo bar		/* { dg-bogus "indented" "^# kandr"    } */
- #undef foo bar		/* { dg-warning "indented" "^ #kandr"  } */
- # undef foo bar	/* { dg-warning "indented" "^ # kandr" } */
+ #undef foo bar		/* { dg-warning "2:indented" "^ #kandr"  } */
+ # undef foo bar	/* { dg-warning "2:indented" "^ # kandr" } */
 
 /* Block 2: C89 directives should not have the # indented to warn.  */
 
-#error whatever		/* { dg-warning "indented" "^#c89"     } */
-# error whatever	/* { dg-warning "indented" "^# c89"    } */
+#error whatever		/* { dg-warning "1:indented" "^#c89"     } */
+# error whatever	/* { dg-warning "1:indented" "^# c89"    } */
  #error whatever	/* { dg-bogus "indented" "^ #c89"      } */
  # error whatever	/* { dg-bogus "indented" "^ # c89"     } */
 
 /* Block 3: Extensions should not have the # indented to warn, and
    they should _not_ get a -pedantic warning. */
 
-#unassert foo(bar)		/* { dg-warning "indented" "^#ext"    } */
-# unassert bar(baz)		/* { dg-warning "indented" "^# ext"   } */
+#unassert foo(bar)		/* { dg-warning "1:indented" "^#ext"    } */
+# unassert bar(baz)		/* { dg-warning "1:indented" "^# ext"   } */
  #unassert baz(quux)		/* { dg-bogus "indented" "^ #ext"     } */
  # unassert quux(weeble)	/* { dg-bogus "indented" "^ # ext"    } */
 
Index: gcc/testsuite/gcc.dg/cpp/counter-2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/counter-2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/counter-2.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright 2007, 2008 Free Software Foundation, Inc.
    Contributed by Ollie Wild <aaw@google.com>.  */
 
 /* { dg-do preprocess } */
@@ -10,5 +10,5 @@
 #ifdef __COUNTER__  /* Macro not expanded. */
 #endif
 
-#if __COUNTER__ == 0  /* { dg-error "__COUNTER__ expanded inside directive with -fdirectives-only" } */
+#if __COUNTER__ == 0  /* { dg-error "5:__COUNTER__ expanded inside directive with -fdirectives-only" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/pr35322.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/pr35322.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/pr35322.c	(working copy)
@@ -1,4 +1,4 @@
 /* Test case for PR 35322 -- _Pragma ICE.  */
 
 /* { dg-do preprocess } */
-_Pragma("GCC dependency") /* { dg-error "#pragma dependency expects" } */
+_Pragma("GCC dependency") /* { dg-error "24:#pragma dependency expects" } */
Index: gcc/testsuite/gcc.dg/cpp/_Pragma1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/_Pragma1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/_Pragma1.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 
@@ -7,15 +7,15 @@
 /* Within the preprocessor, the easy pragma to test is "poison".  */
 
 #pragma GCC poison p1
-p1				/* { dg-error "poisoned" } */
+p1				/* { dg-error "1:poisoned" } */
 
 /* Standard use of _Pragma.  */
 _Pragma ("GCC poison p2")
-p2				/* { dg-error "poisoned" } */
+p2				/* { dg-error "1:poisoned" } */
 
 /* Don't interpret _Pragmas in directives.  The standard is not clear
    on this, but I think this makes most sense.  */
-#if 1 _Pragma (L"GCC poison p3") /* { dg-error "missing binary operator" } */
+#if 1 _Pragma (L"GCC poison p3") /* { dg-error "7:missing binary operator" } */
 p3
 #endif
 
@@ -24,8 +24,8 @@
 #define M2(x) _Pragma (#x)
 
 /* Now test macro expansion with embedded _Pragmas.  */
-M1 p4				/* { dg-error "poisoned" } */
-M2 (GCC poison p5) p5		/* { dg-error "poisoned" } */
+M1 p4				/* { dg-error "4:poisoned" } */
+M2 (GCC poison p5) p5		/* { dg-error "20:poisoned" } */
 
 /* Not interpreting _Pragma in directives means they don't nest.  */
 _Pragma ("_Pragma (\"GCC poison p6\") GCC poison p7")
Index: gcc/testsuite/gcc.dg/cpp/20000209-1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/20000209-1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/20000209-1.c	(working copy)
@@ -7,28 +7,28 @@
 #define g f
 
 f (3);
-#error here	/* { dg-error "here" "case 0" } */
+#error here	/* { dg-error "2:here" "case 0" } */
 
 f
   (3);
-#error here	/* { dg-error "here" "case 1" } */
+#error here	/* { dg-error "2:here" "case 1" } */
 
 (f
   )(3);
-#error here	/* { dg-error "here" "case 2" } */
+#error here	/* { dg-error "2:here" "case 2" } */
 
 g
   (3);
-#error here	/* { dg-error "here" "case 3" } */
+#error here	/* { dg-error "2:here" "case 3" } */
 
 (g
   )(3);
-#error here	/* { dg-error "here" "case 4" } */
+#error here	/* { dg-error "2:here" "case 4" } */
 
 f /* some
      text */  (3);
-#error here	/* { dg-error "here" "case 5" } */
+#error here	/* { dg-error "2:here" "case 5" } */
 
 (g /* some
       text */ )(3);
-#error here	/* { dg-error "here" "case 6" } */
+#error here	/* { dg-error "2:here" "case 6" } */
Index: gcc/testsuite/gcc.dg/cpp/paste4.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/paste4.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/paste4.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 /* { dg-do compile } */
 /* { dg-options -save-temps } */
 
@@ -11,7 +11,7 @@
 
 int main ()
 {
-  double d = glue (1.0e, +1); /* { dg-error "exponent|parse error|syntax error|expected" } */
+  double d = glue (1.0e, +1); /* { dg-error "14:exponent|parse error|syntax error|expected" } */
   return 0;
 }
 
Index: gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c	(working copy)
@@ -2,5 +2,5 @@
 /* { dg-options "-std=iso9899:1999 -pedantic -Werror" } */
 
 #define f(x,...)
-#define g(x,y...)	/* { dg-error "variadic" } */
+#define g(x,y...)	/* { dg-error "14:variadic" } */
 int not_empty;
Index: gcc/testsuite/gcc.dg/cpp/pr36320.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/pr36320.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/pr36320.c	(working copy)
@@ -4,5 +4,5 @@
 
 int z;
 #if 1
-#elif   /* { dg-error "with no expression" } */
+#elif   /* { dg-error "1:with no expression" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/sysmac1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/sysmac1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/sysmac1.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.  */
+/* Copyright (C) 2001, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 /* { dg-options "-std=gnu99 -pedantic -Wtraditional" } */
@@ -12,15 +12,15 @@
 
 #define uint 1U
 #define str(x) x
-#define foo(x, y...) bar(x, ##y) /* { dg-warning "named variadic macros" } */
+#define foo(x, y...) bar(x, ##y) /* { dg-warning "17:named variadic macros" } */
 
-#if uint			/* { dg-warning "traditional C rejects" } */
+#if uint			/* { dg-warning "5:traditional C rejects" } */
 #endif
 #if sys_uint			/* { dg-bogus "traditional C rejects" } */
 #endif
 
-(str);				/* { dg-warning "used with arguments" } */
+(str);				/* { dg-warning "2:used with arguments" } */
 (sys_str);			/* { dg-bogus "used with arguments" } */
 
-foo (one_arg);			/* { dg-warning "requires rest arguments" } */
+foo (one_arg);			/* { dg-warning "13:requires rest arguments" } */
 sys_foo (one_arg);		/* { dg-bogus "requires rest arguments" } */
Index: gcc/testsuite/gcc.dg/cpp/very-long-comment.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/very-long-comment.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/very-long-comment.c	(working copy)
@@ -5,7 +5,7 @@
    comment so avoid editing the text above here. */
 /* { dg-options "-Wall" } */
 /* { dg-do compile } */
-#warning test warning /* { dg-warning "test warning" } */
+#warning test warning /* { dg-warning "2:test warning" } */
 #include <stdio.h>
 int main()
 {
Index: gcc/testsuite/gcc.dg/cpp/pr29612-2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/pr29612-2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/pr29612-2.c	(working copy)
@@ -1,10 +1,10 @@
 /* PR preprocessor/29612 */
 /* { dg-do preprocess } */
-/* { dg-options "-Wtraditional -fno-show-column" } */
+/* { dg-options "-Wtraditional" } */
 
 # 6 "pr29612-2.c"
 
-#if 1U /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+#if 1U /* { dg-warning "5:traditional C rejects" "numeric constant suffix" } */
 #endif
 
 # 1 "foo.h" 1 3
@@ -14,5 +14,5 @@
 
 # 16 "pr29612-2.c" 2
 
-#if 1U /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+#if 1U /* { dg-warning "5:traditional C rejects" "numeric constant suffix" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/c89-pedantic.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/c89-pedantic.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/c89-pedantic.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 /* { dg-options "-std=c89 -pedantic" } */
@@ -6,5 +6,5 @@
 /* This file is for testing the preprocessor in -std=c89 -pedantic mode.
    Neil Booth, 2 Dec 2000.  */
 
-#if 1LL				/* { dg-warning "long long" } */
+#if 1LL				/* { dg-warning "5:long long" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/if-5.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/if-5.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/if-5.c	(working copy)
@@ -2,8 +2,8 @@
    Jakub Jelinek <jakub@redhat.com>.  */
 /* { dg-do preprocess } */
 
-#ifdef 0  /* { dg-error "macro names" } */
+#ifdef 0  /* { dg-error "8:macro names" } */
 #endif
 
-#ifndef 0  /* { dg-error "macro names" } */
+#ifndef 0  /* { dg-error "9:macro names" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/tr-warn4.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/tr-warn4.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/tr-warn4.c	(working copy)
@@ -2,11 +2,11 @@
    Note, gcc should omit these warnings in system header files.
    By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000.  */
 /* { dg-do preprocess } */
-/* { dg-options "-Wtraditional -fno-show-column" } */
+/* { dg-options "-Wtraditional" } */
 
-#if 1U /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+#if 1U /* { dg-warning "5:traditional C rejects" "numeric constant suffix" } */
 #endif
-#if 1u /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+#if 1u /* { dg-warning "5:traditional C rejects" "numeric constant suffix" } */
 #endif
 #if 1L
 #endif
Index: gcc/testsuite/gcc.dg/cpp/19951227-1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/19951227-1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/19951227-1.c	(working copy)
@@ -1,3 +1,3 @@
 /* { dg-do preprocess } */
-#if 0xe-1	/* { dg-error "invalid suffix" } */
+#if 0xe-1	/* { dg-error "5:invalid suffix" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/charconst.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/charconst.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/charconst.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.  */
+/* Copyright (C) 2001, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do compile } */
 
@@ -7,16 +7,16 @@
 
    Neil Booth, 22 May 2001.  */
 
-#if ''			/* { dg-error "empty" "empty charconst" } */
+#if ''			/* { dg-error "5:empty" "empty charconst" } */
 #endif
-#if L''			/* { dg-error "empty" "empty wide charconst" } */
+#if L''			/* { dg-error "5:empty" "empty wide charconst" } */
 #endif
-#if 'very long'		/* { dg-warning "too long" "long charconst" } */
+#if 'very long'		/* { dg-warning "5:too long" "long charconst" } */
 #endif
-#if L'very long'	/* { dg-warning "too long" "long wide charconst" } */
+#if L'very long'	/* { dg-warning "5:too long" "long wide charconst" } */
 #endif
 /* Don't do this test for L'ab'; it depends upon sizeof (wchar_t).  */
-#if 'ab'		/* { dg-warning "multi-char" "multi-character" } */
+#if 'ab'		/* { dg-warning "5:multi-char" "multi-character" } */
 #endif
 
 void foo ()
@@ -24,13 +24,13 @@
   int c;
   __WCHAR_TYPE__ w;
 
-  c = '';		/* { dg-error "empty" "empty charconst" } */
-  w = L'';		/* { dg-error "empty" "empty wide charconst" } */
+  c = '';		/* { dg-error "7:empty" "empty charconst" } */
+  w = L'';		/* { dg-error "7:empty" "empty wide charconst" } */
 
-  c = 'very long';	/* { dg-warning "too long" "long charconst" } */
-  w = L'very long';	/* { dg-warning "too long" "long wide charconst" } */
+  c = 'very long';	/* { dg-warning "7:too long" "long charconst" } */
+  w = L'very long';	/* { dg-warning "7:too long" "long wide charconst" } */
 
-  c = 'ab';		/* { dg-warning "multi-char" "multi-char" } */
+  c = 'ab';		/* { dg-warning "7:multi-char" "multi-char" } */
   /* Wide charconsts cannot contain more than one wide character.  */
-  w = L'ab';		/* { dg-warning "too long" "multi-char wide" } */
+  w = L'ab';		/* { dg-warning "7:too long" "multi-char wide" } */
 }
Index: gcc/testsuite/gcc.dg/cpp/c99-if-comma-1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/c99-if-comma-1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/c99-if-comma-1.c	(working copy)
@@ -4,7 +4,7 @@
 /* { dg-do preprocess } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
 
-#if (1, 2) /* { dg-error "comma" "evaluated comma" } */
+#if (1, 2) /* { dg-error "7:comma" "evaluated comma" } */
 #endif
 
 #if 1 || (1, 2)
Index: gcc/testsuite/gcc.dg/cpp/Wtrigraphs.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/Wtrigraphs.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/Wtrigraphs.c	(working copy)
@@ -1,26 +1,26 @@
 /* { dg-do preprocess } */
-/* { dg-options "-std=gnu99 -Wtrigraphs -fno-show-column" } */
+/* { dg-options "-std=gnu99 -Wtrigraphs" } */
 
 /* Test we don't double warn for trigraphs immediately after preceding
    text.  Source Neil Booth.  22 Nov 2000.  */
 
-abcdef??<			/* { dg-warning "ignored" } */
-123456??>			/* { dg-warning "ignored" } */
-+??=				/* { dg-warning "ignored" } */
+abcdef??<			/* { dg-warning "7:ignored" } */
+123456??>			/* { dg-warning "7:ignored" } */
++??=				/* { dg-warning "2:ignored" } */
 
 /* Test we warn of escaped newlines only in comments.  Source Neil
    Booth.  4 May 2003.  */
 
 /* { dg-bogus "ignored" } Test ??< ??= a few ??/ random things in
-   { dg-warning "ignored" } some ??/
+   { dg-warning "37:ignored" } some ??/
    { dg-bogus "ignored" } ??< comments.  */
 
 // { dg-bogus "ignored" } More ??/ comment ??> tests.
 
-// { dg-warning "ignored" } Another ??/
+// { dg-warning "40:ignored" } Another ??/
    Test
 
-// { dg-warning "ignored" } And another with space after ??/  
+// { dg-warning "61:ignored" } And another with space after ??/  
    the escape
 
 // { dg-bogus "ignored" } A tricky one ??/\
Index: gcc/testsuite/gcc.dg/cpp/if-cexp.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/if-cexp.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/if-cexp.c	(working copy)
@@ -3,12 +3,12 @@
 /* Test the ? : opearator, for precedence and both true and false.  */
 
 #if  1 ? 1 ? 2 : 0 : 0
-#error OK	/* { dg-error "OK" "nested ? :" } */
+#error OK	/* { dg-error "2:OK" "nested ? :" } */
 #endif
 
 #if  ((0) ? (1) ? (2) : (3) : (4) ? (5): (6)) == 5
-#error OK	/* { dg-error "OK" "nested ? : with parens" } */
+#error OK	/* { dg-error "2:OK" "nested ? : with parens" } */
 #endif
 
-#if 2:		/* { dg-error "':' without" "immediate :" } */
+#if 2:		/* { dg-error "6:':' without" "immediate :" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.  */
+/* Copyright (C) 2002, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 /* { dg-options "-Wno-endif-labels -pedantic-errors" } */
@@ -11,7 +11,7 @@
 
 #if 1 
 #if 0
-#else foo	/* { dg-error "extra tokens" "tokens after #else" } */
-#endif /	/* { dg-error "extra tokens" "tokens after #endif" } */
+#else foo	/* { dg-error "7:extra tokens" "tokens after #else" } */
+#endif /	/* { dg-error "8:extra tokens" "tokens after #endif" } */
 #endif
 
Index: gcc/testsuite/gcc.dg/cpp/macsyntx.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/macsyntx.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/macsyntx.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 /* { dg-options "-pedantic -std=gnu99" } */
@@ -19,22 +19,22 @@
    Split a couple of the lines to check that the errors appear on the
    right line (i.e. are associated with the correct token).  */
 
-#define ;			/* { dg-error "identifier" } */
-#define SEMI;			/* { dg-warning "space" } */
-#define foo(X			/* { dg-error "missing" } */
+#define ;			/* { dg-error "9:identifier" } */
+#define SEMI;			/* { dg-warning "13:space" } */
+#define foo(X			/* { dg-error "12:missing" } */
 #define foo\
-(X,)				/* { dg-error "parameter name" } */
-#define foo(, X)		/* { dg-error "parameter name" } */
-#define foo(X, X)		/* { dg-error "duplicate" } */
-#define foo(X Y)		/* { dg-error "comma" } */
-#define foo(()			/* { dg-error "may not appear" } */
-#define foo(..., X)		/* { dg-error "missing" } */
+(X,)				/* { dg-error "4:parameter name" } */
+#define foo(, X)		/* { dg-error "13:parameter name" } */
+#define foo(X, X)		/* { dg-error "16:duplicate" } */
+#define foo(X Y)		/* { dg-error "15:comma" } */
+#define foo(()			/* { dg-error "13:may not appear" } */
+#define foo(..., X)		/* { dg-error "16:missing" } */
 #define foo \
-__VA_ARGS__			/* { dg-warning "__VA_ARGS__" } */
-#define goo(__VA_ARGS__)	/* { dg-warning "__VA_ARGS__" } */
+__VA_ARGS__			/* { dg-warning "1:__VA_ARGS__" } */
+#define goo(__VA_ARGS__)	/* { dg-warning "13:__VA_ARGS__" } */
 #define hoo(...) __VA_ARGS__	/* OK.  */
-#define __VA_ARGS__		/* { dg-warning "__VA_ARGS__" } */
-__VA_ARGS__			/* { dg-warning "__VA_ARGS__" } */
+#define __VA_ARGS__		/* { dg-warning "9:__VA_ARGS__" } */
+__VA_ARGS__			/* { dg-warning "1:__VA_ARGS__" } */
 
 /* test # of supplied arguments.  */
 #define none()
@@ -57,9 +57,9 @@
 
 /* This tests two oddities of GNU rest args - omitting a comma is OK,
    and backtracking a token on pasting an empty rest args.  */
-#define rest(x, y...) x ## y	/* { dg-warning "ISO C" } */
+#define rest(x, y...) x ## y	/* { dg-warning "18:ISO C" } */
 rest(ichi,)			/* OK.  */
-rest(ichi)			/* { dg-warning "rest arguments to be used" } */
+rest(ichi)			/* { dg-warning "10:rest arguments to be used" } */
 #if 23 != rest(2, 3)		/* OK, no warning.  */
 #error 23 != 23 !!
 #endif
Index: gcc/testsuite/gcc.dg/cpp/poison.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/poison.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/poison.c	(working copy)
@@ -1,25 +1,24 @@
-/* { dg-do preprocess }
-   { dg-options "-fno-show-column" } */
+/* { dg-do preprocess } */
 
 #pragma GCC poison foo
-foo			/* { dg-error "foo" "use of foo" } */
+foo			/* { dg-error "1:foo" "use of foo" } */
 #pragma GCC poison foo2 foo3
-foo2			/* { dg-error "foo2" "use of foo2" } */
-foo3			/* { dg-error "foo3" "use of foo3" } */
+foo2			/* { dg-error "1:foo2" "use of foo2" } */
+foo3			/* { dg-error "1:foo3" "use of foo3" } */
 #pragma GCC poison	foo4 	foo5
-foo4			/* { dg-error "foo4" "use of foo4" } */
-foo5			/* { dg-error "foo5" "use of foo5" } */
-#pragma GCC poison +++	/* { dg-error "invalid" "poison non-identifier" } */
+foo4			/* { dg-error "1:foo4" "use of foo4" } */
+foo5			/* { dg-error "1:foo5" "use of foo5" } */
+#pragma GCC poison +++	/* { dg-error "20:invalid" "poison non-identifier" } */
 #define foo6 123
-#pragma GCC poison foo6	/* { dg-warning "foo6" "poison defined macro" } */
-#define foo6 345	/* { dg-error "foo6" "def of foo6" } */
-#define foo6 456	/* { dg-error "foo6" "redef of foo6" } */
-#ifdef foo6		/* { dg-error "foo6" "#ifdef foo6" } */
+#pragma GCC poison foo6	/* { dg-warning "20:foo6" "poison defined macro" } */
+#define foo6 345	/* { dg-error "9:foo6" "def of foo6" } */
+#define foo6 456	/* { dg-error "9:foo6" "redef of foo6" } */
+#ifdef foo6		/* { dg-error "8:foo6" "#ifdef foo6" } */
 #error hey! foo6 defined!
 #endif
-#if defined(foo6)	/* { dg-error "foo6" "#if defined foo6" } */
+#if defined(foo6)	/* { dg-error "13:foo6" "#if defined foo6" } */
 #error foo6 still defined!
 #else
-foo6			/* { dg-error "foo6" "use of foo6" } */
+foo6			/* { dg-error "1:foo6" "use of foo6" } */
 #endif
 #pragma GCC poison
Index: gcc/testsuite/gcc.dg/cpp/sysmac2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/sysmac2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/sysmac2.c	(working copy)
@@ -1,7 +1,7 @@
 /* Copyright (C) 2001 Free Software Foundation, Inc.  */
 
 /* { dg-do compile } */
-/* { dg-options "-std=gnu99 -pedantic -Wtraditional -fno-show-column" } */
+/* { dg-options "-std=gnu99 -pedantic -Wtraditional" } */
 
 /* Tests diagnostics are suppressed for some macros defined in system
    headers.  */
@@ -17,11 +17,11 @@
 int
 main ()
 {
-  int u1 = uint;		/* { dg-warning "traditional C rejects" } */
+  int u1 = uint;		/* { dg-warning "12:traditional C rejects" } */
   int u2 = sys_uint;		/* { dg-bogus "traditional C rejects" } */
-  float f1 = fl;		/* { dg-warning "traditional C rejects" } */
+  float f1 = fl;		/* { dg-warning "14:traditional C rejects" } */
   float f2 = sys_fl;		/* { dg-bogus "traditional C rejects" } */
-  long double ld1 = ld;		/* { dg-warning "traditional C rejects" } */
+  long double ld1 = ld;		/* { dg-warning "21:traditional C rejects" } */
   long double l2 = sys_ld;	/* { dg-bogus "traditional C rejects" } */
 
   return 0;
Index: gcc/testsuite/gcc.dg/cpp/pr22168-2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/pr22168-2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/pr22168-2.c	(working copy)
@@ -3,10 +3,10 @@
 
 /* { dg-do preprocess }
    { dg-options -Wdeprecated } */
-#if #foo(bar)    /* { dg-warning "deprecated" } */
+#if #foo(bar)    /* { dg-warning "5:deprecated" } */
 int x;
 #else
 int y;
 #endif
-#assert zzz(a)   /* { dg-warning "deprecated" } */
-#unassert yyy    /* { dg-warning "deprecated" } */
+#assert zzz(a)   /* { dg-warning "1:deprecated" } */
+#unassert yyy    /* { dg-warning "1:deprecated" } */
Index: gcc/testsuite/gcc.dg/cpp/pr28165.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/pr28165.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/pr28165.c	(working copy)
@@ -1,6 +1,6 @@
-/* Copyright (C) 2007 Free Software Foundation, Inc.  */
+/* Copyright (C) 2007, 2008 Free Software Foundation, Inc.  */
 /* PR preprocessor/28165 */
 
 /* { dg-do preprocess } */
-#pragma GCC system_header   /* { dg-warning "system_header" "ignored" } */
-_Pragma ("GCC system_header")   /* { dg-warning "system_header" "ignored" } */
+#pragma GCC system_header   /* { dg-warning "13:system_header" "ignored" } */
+_Pragma ("GCC system_header") /* { dg-warning "15:system_header" "ignored" } */
Index: gcc/testsuite/gcc.dg/cpp/cpp.exp
===================================================================
--- gcc/testsuite/gcc.dg/cpp/cpp.exp	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/cpp.exp	(working copy)
@@ -1,4 +1,4 @@
-#   Copyright (C) 1997, 2000, 2003, 2007 Free Software Foundation, Inc.
+#   Copyright (C) 1997, 2000, 2003, 2007, 2008 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@
 
 # Main loop.
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{c,S} ]] \
-	"-fno-show-column" $DEFAULT_CFLAGS
+	"" $DEFAULT_CFLAGS
 
 # All done.
 dg-finish
Index: gcc/testsuite/gcc.dg/cpp/gnuc89-pedantic.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/gnuc89-pedantic.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/gnuc89-pedantic.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 /* { dg-options "-std=gnu89 -pedantic" } */
@@ -6,5 +6,5 @@
 /* This file is for testing the preprocessor in -std=gnu89 -pedantic mode.
    Neil Booth, 2 Dec 2000.  */
 
-#if 1LL				/* { dg-warning "long long" } */
+#if 1LL				/* { dg-warning "5:long long" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/widestr1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/widestr1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/widestr1.c	(working copy)
@@ -1,9 +1,9 @@
-/* Copyright (C) 2000, 2001  Free Software Foundation.
+/* Copyright (C) 2000, 2001, 2008  Free Software Foundation.
 
    by Alexandre Oliva  <oliva@lsd.ic.unicamp.br>  */
 
 /* { dg-do preprocess } */
 
-#line 1 L"foo" /* { dg-error "not a valid filename" "wide string in #line" } */
-#include L"stdio.h" /* { dg-error "expects" "wide string in #include" } */
+#line 1 L"foo" /* { dg-error "9:not a valid filename" "wide string in #line" } */
+#include L"stdio.h" /* { dg-error "10:expects" "wide string in #include" } */
 
Index: gcc/testsuite/gcc.dg/cpp/tr-warn5.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/tr-warn5.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/tr-warn5.c	(working copy)
@@ -2,9 +2,9 @@
    Note, gcc should omit these warnings in system header files.
    By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000.  */
 /* { dg-do preprocess } */
-/* { dg-options "-Wtraditional -fno-show-column" } */
+/* { dg-options "-Wtraditional" } */
 
-#if +1 /* { dg-warning "unary plus operator" "unary plus operator" } */
+#if +1 /* { dg-warning "5:unary plus operator" "unary plus operator" } */
 #endif
   
 # 11 "sys-header.h" 3
Index: gcc/testsuite/gcc.dg/cpp/paste15.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/paste15.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/paste15.c	(working copy)
@@ -1,15 +1,15 @@
 /* PR preprocessor/20077 */
 /* { dg-do preprocess } */
 
-#define a   a ## ## /* { dg-error "end of a macro expansion" } */
-#define b() b ## ## /* { dg-error "end of a macro expansion" } */
-#define c   c ##    /* { dg-error "end of a macro expansion" } */
-#define d() d ##    /* { dg-error "end of a macro expansion" } */
+#define a   a ## ## /* { dg-error "18:end of a macro expansion" } */
+#define b() b ## ## /* { dg-error "18:end of a macro expansion" } */
+#define c   c ##    /* { dg-error "15:end of a macro expansion" } */
+#define d() d ##    /* { dg-error "15:end of a macro expansion" } */
 
 
-#define e   ## ## e /* { dg-error "end of a macro expansion" } */
-#define f() ## ## f /* { dg-error "end of a macro expansion" } */
-#define g   ## g    /* { dg-error "end of a macro expansion" } */
-#define h() ## h    /* { dg-error "end of a macro expansion" } */
-#define i   ##      /* { dg-error "end of a macro expansion" } */
-#define j() ##      /* { dg-error "end of a macro expansion" } */
+#define e   ## ## e /* { dg-error "13:end of a macro expansion" } */
+#define f() ## ## f /* { dg-error "13:end of a macro expansion" } */
+#define g   ## g    /* { dg-error "13:end of a macro expansion" } */
+#define h() ## h    /* { dg-error "13:end of a macro expansion" } */
+#define i   ##      /* { dg-error "13:end of a macro expansion" } */
+#define j() ##      /* { dg-error "13:end of a macro expansion" } */
Index: gcc/testsuite/gcc.dg/cpp/error-1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/error-1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/error-1.c	(working copy)
@@ -2,4 +2,4 @@
 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
 /* { dg-do preprocess } */
 
-/* { dg-error "unterminated comment" }
+/* { dg-error "1:unterminated comment" }
Index: gcc/testsuite/gcc.dg/cpp/Wunused.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/Wunused.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/Wunused.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.  */
+/* Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 /* Duplicate command line options should not warn.  */
@@ -15,9 +15,9 @@
 #define used3			/* { dg-bogus "used" } */
 #define used4 used4		/* { dg-bogus "used" } */
 
-#define unused5			/* { dg-warning "used" } */
-#define unused6			/* { dg-warning "used" } */
-#define unused7()		/* { dg-warning "used" } */
+#define unused5			/* { dg-warning "9:used" } */
+#define unused6			/* { dg-warning "9:used" } */
+#define unused7()		/* { dg-warning "9:used" } */
 
 #if defined used1
 #endif
Index: gcc/testsuite/gcc.dg/cpp/20000129-1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/20000129-1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/20000129-1.c	(working copy)
@@ -12,4 +12,4 @@
 	blah	\
 	blah
 
-??>	/* { dg-warning "trigraph ..." "trigraph encountered" } */
+??>	/* { dg-warning "1:trigraph ..." "trigraph encountered" } */
Index: gcc/testsuite/gcc.dg/cpp/pr7263-2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/pr7263-2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/pr7263-2.c	(working copy)
@@ -11,7 +11,7 @@
 unsigned long long /* { dg-error "ISO C90 does not support .long long." } */
 bar2 ()
 {
-  return 0x1b27da572ef3cd86ULL; /* { dg-error "use of C99 long long integer constant" } */
+  return 0x1b27da572ef3cd86ULL; /* { dg-error "10:use of C99 long long integer constant" } */
 }
 
 
Index: gcc/testsuite/gcc.dg/cpp/Wmissingdirs.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/Wmissingdirs.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/Wmissingdirs.c	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do preprocess } */
-/* { dg-options "-std=gnu99 -I /jolly/well/better/not/exist -Wmissing-include-dirs -fno-show-column" } */
+/* { dg-options "-std=gnu99 -I /jolly/well/better/not/exist -Wmissing-include-dirs" } */
 
 /* Test that -Wmissing-include-dirs issues a warning when a specified
    directory does not exist.  Source Ben Elliston, 2004-05-13.  */
Index: gcc/testsuite/gcc.dg/cpp/skipping2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/skipping2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/skipping2.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.  */
+/* Copyright (C) 2001, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 
@@ -10,5 +10,5 @@
 #if foo
 #else foo   /* { dg-bogus "extra tokens" "extra tokens in skipped block" } */
 #endif foo  /* { dg-bogus "extra tokens" "extra tokens in skipped block" } */
-#endif bar  /* { dg-error "extra tokens" "tokens after #endif" } */
+#endif bar  /* { dg-error "8:extra tokens" "tokens after #endif" } */
 
Index: gcc/testsuite/gcc.dg/cpp/c94-pedantic.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/c94-pedantic.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/c94-pedantic.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 /* { dg-options "-std=iso9899:199409 -pedantic" } */
@@ -6,5 +6,5 @@
 /* This file is for testing the preprocessor in -std=iso9899:199409
    -pedantic mode.  Neil Booth, 2 Dec 2000.  */
 
-#if 1LL				/* { dg-warning "long long" } */
+#if 1LL				/* { dg-warning "5:long long" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/Wtrigraphs-2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/Wtrigraphs-2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/Wtrigraphs-2.c	(working copy)
@@ -1,19 +1,19 @@
 /* { dg-do preprocess } */
-/* { dg-options "-std=c99 -Wtrigraphs -fno-show-column" } */
+/* { dg-options "-std=c99 -Wtrigraphs" } */
 
 /* Test warnings for trigraphs in comments, with trigraphs enabled.
    Neil Booth.  4 May 2003.  */
 
 /* { dg-bogus "converted" } Test ??< ??= a few ??/ random things in
-   { dg-warning "converted" } some ??/
+   { dg-warning "39:converted" } some ??/
    { dg-bogus "converted" } ??< comments.  */
 
 // { dg-bogus "converted" } More ??/ comment ??> tests.
 
-// { dg-warning "converted" } Another ??/
+// { dg-warning "42:converted" } Another ??/
    Test
 
-// { dg-warning "converted" } And another with space after ??/  
+// { dg-warning "63:converted" } And another with space after ??/  
    the escape
 
 // { dg-bogus "converted" } A tricky one ??/\
Index: gcc/testsuite/gcc.dg/cpp/pr7263-3.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/pr7263-3.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/pr7263-3.c	(working copy)
@@ -15,5 +15,5 @@
 
 __complex__ bar3 () /* { dg-error "ISO C does not support plain .complex. meaning .double complex." } */
 {
-  return _Complex_I; /* { dg-error "imaginary constants are a GCC extension" } */
+  return _Complex_I; /* { dg-error "10:imaginary constants are a GCC extension" } */
 }
Index: gcc/testsuite/gcc.dg/cpp/macspace1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/macspace1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/macspace1.c	(working copy)
@@ -1,63 +1,64 @@
 /* PR preprocessor/19475 */
 /* { dg-do preprocess } */
-/* { dg-options "-std=iso9899:1990 -pedantic-errors -fno-show-column" } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
 
-#define a!		/* { dg-warning "missing whitespace" } */
-#define b"		/* { dg-warning "missing whitespace" } */
-#define c#		/* { dg-warning "missing whitespace" } */
-#define d%		/* { dg-warning "missing whitespace" } */
-#define e&		/* { dg-warning "missing whitespace" } */
-#define f'		/* { dg-warning "missing whitespace" } */
-#define g)		/* { dg-warning "missing whitespace" } */
-#define h*		/* { dg-warning "missing whitespace" } */
-#define i+		/* { dg-warning "missing whitespace" } */
-#define j,		/* { dg-warning "missing whitespace" } */
-#define k-		/* { dg-warning "missing whitespace" } */
-#define l.		/* { dg-warning "missing whitespace" } */
-#define m/		/* { dg-warning "missing whitespace" } */
-#define n:		/* { dg-warning "missing whitespace" } */
-#define o;		/* { dg-warning "missing whitespace" } */
-#define p<		/* { dg-warning "missing whitespace" } */
-#define q=		/* { dg-warning "missing whitespace" } */
-#define r>		/* { dg-warning "missing whitespace" } */
-#define s?		/* { dg-warning "missing whitespace" } */
-#define t[		/* { dg-warning "missing whitespace" } */
-#define u]		/* { dg-warning "missing whitespace" } */
-#define v^		/* { dg-warning "missing whitespace" } */
-#define w{		/* { dg-warning "missing whitespace" } */
-#define x|		/* { dg-warning "missing whitespace" } */
-#define y}		/* { dg-warning "missing whitespace" } */
-#define z~		/* { dg-warning "missing whitespace" } */
-#define A>>		/* { dg-warning "missing whitespace" } */
-#define B<<		/* { dg-warning "missing whitespace" } */
-#define E&&		/* { dg-warning "missing whitespace" } */
-#define F||		/* { dg-warning "missing whitespace" } */
-#define G==		/* { dg-warning "missing whitespace" } */
-#define H!=		/* { dg-warning "missing whitespace" } */
-#define I>=		/* { dg-warning "missing whitespace" } */
-#define J<=		/* { dg-warning "missing whitespace" } */
-#define K+=		/* { dg-warning "missing whitespace" } */
-#define L-=		/* { dg-warning "missing whitespace" } */
-#define M*=		/* { dg-warning "missing whitespace" } */
-#define N/=		/* { dg-warning "missing whitespace" } */
-#define O%=		/* { dg-warning "missing whitespace" } */
-#define P&=		/* { dg-warning "missing whitespace" } */
-#define Q|=		/* { dg-warning "missing whitespace" } */
-#define R^=		/* { dg-warning "missing whitespace" } */
-#define S>>=		/* { dg-warning "missing whitespace" } */
-#define T<<=		/* { dg-warning "missing whitespace" } */
-#define W...		/* { dg-warning "missing whitespace" } */
-#define X++		/* { dg-warning "missing whitespace" } */
-#define Y--		/* { dg-warning "missing whitespace" } */
-#define Z->		/* { dg-warning "missing whitespace" } */
-#define aa::		/* { dg-warning "missing whitespace" } */
-#define ab->*		/* { dg-warning "missing whitespace" } */
-#define ac.*		/* { dg-warning "missing whitespace" } */
-#define ad\x		/* { dg-warning "missing whitespace" } */
-#define ae\\x		/* { dg-warning "missing whitespace" } */
-#define af'1'		/* { dg-warning "missing whitespace" } */
-#define ag"abc"		/* { dg-warning "missing whitespace" } */
+#define a!		/* { dg-warning "10:missing whitespace" } */
+/* Note: no tab characters on the next line.  */
+#define b"              /* { dg-warning "10:missing whitespace" } */
+#define c#		/* { dg-warning "10:missing whitespace" } */
+#define d%		/* { dg-warning "10:missing whitespace" } */
+#define e&		/* { dg-warning "10:missing whitespace" } */
+#define f'		/* { dg-warning "10:missing whitespace" } */
+#define g)		/* { dg-warning "10:missing whitespace" } */
+#define h*		/* { dg-warning "10:missing whitespace" } */
+#define i+		/* { dg-warning "10:missing whitespace" } */
+#define j,		/* { dg-warning "10:missing whitespace" } */
+#define k-		/* { dg-warning "10:missing whitespace" } */
+#define l.		/* { dg-warning "10:missing whitespace" } */
+#define m/		/* { dg-warning "10:missing whitespace" } */
+#define n:		/* { dg-warning "10:missing whitespace" } */
+#define o;		/* { dg-warning "10:missing whitespace" } */
+#define p<		/* { dg-warning "10:missing whitespace" } */
+#define q=		/* { dg-warning "10:missing whitespace" } */
+#define r>		/* { dg-warning "10:missing whitespace" } */
+#define s?		/* { dg-warning "10:missing whitespace" } */
+#define t[		/* { dg-warning "10:missing whitespace" } */
+#define u]		/* { dg-warning "10:missing whitespace" } */
+#define v^		/* { dg-warning "10:missing whitespace" } */
+#define w{		/* { dg-warning "10:missing whitespace" } */
+#define x|		/* { dg-warning "10:missing whitespace" } */
+#define y}		/* { dg-warning "10:missing whitespace" } */
+#define z~		/* { dg-warning "10:missing whitespace" } */
+#define A>>		/* { dg-warning "10:missing whitespace" } */
+#define B<<		/* { dg-warning "10:missing whitespace" } */
+#define E&&		/* { dg-warning "10:missing whitespace" } */
+#define F||		/* { dg-warning "10:missing whitespace" } */
+#define G==		/* { dg-warning "10:missing whitespace" } */
+#define H!=		/* { dg-warning "10:missing whitespace" } */
+#define I>=		/* { dg-warning "10:missing whitespace" } */
+#define J<=		/* { dg-warning "10:missing whitespace" } */
+#define K+=		/* { dg-warning "10:missing whitespace" } */
+#define L-=		/* { dg-warning "10:missing whitespace" } */
+#define M*=		/* { dg-warning "10:missing whitespace" } */
+#define N/=		/* { dg-warning "10:missing whitespace" } */
+#define O%=		/* { dg-warning "10:missing whitespace" } */
+#define P&=		/* { dg-warning "10:missing whitespace" } */
+#define Q|=		/* { dg-warning "10:missing whitespace" } */
+#define R^=		/* { dg-warning "10:missing whitespace" } */
+#define S>>=		/* { dg-warning "10:missing whitespace" } */
+#define T<<=		/* { dg-warning "10:missing whitespace" } */
+#define W...		/* { dg-warning "10:missing whitespace" } */
+#define X++		/* { dg-warning "10:missing whitespace" } */
+#define Y--		/* { dg-warning "10:missing whitespace" } */
+#define Z->		/* { dg-warning "10:missing whitespace" } */
+#define aa::		/* { dg-warning "11:missing whitespace" } */
+#define ab->*		/* { dg-warning "11:missing whitespace" } */
+#define ac.*		/* { dg-warning "11:missing whitespace" } */
+#define ad\x		/* { dg-warning "11:missing whitespace" } */
+#define ae\\x		/* { dg-warning "11:missing whitespace" } */
+#define af'1'		/* { dg-warning "11:missing whitespace" } */
+#define ag"abc"		/* { dg-warning "11:missing whitespace" } */
 
 int dummy;
-/* { dg-error "missing terminating" "" { target *-*-* } 6 } */
+/* { dg-error "63:missing terminating" "" { target *-*-* } 7 } */
 /* { dg-error "missing terminating" "" { target *-*-* } 10 } */
Index: gcc/testsuite/gcc.dg/cpp/escape-2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/escape-2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/escape-2.c	(working copy)
@@ -1,20 +1,20 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.  */
+/* Copyright (C) 2001, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do compile } */
-/* { dg-options "-pedantic -std=c99 -fno-show-column" } */
+/* { dg-options "-pedantic -std=c99" } */
 
 /* This tests various diagnostics with -pedantic about escape
    sequences, for both the preprocessor and the compiler.
 
    Neil Booth, 22 May 2001.  */
 
-#if '\e'		/* { dg-warning "non-ISO" "non-ISO \\e" } */
+#if '\e'		/* { dg-warning "5:non-ISO" "non-ISO \\e" } */
 #endif
-#if L'\u00a0'		/* { dg-bogus "unknown" "\\u is known in C99" } */
+#if L'\u00a0'		/* { dg-bogus "5:unknown" "\\u is known in C99" } */
 #endif
 
 void foo ()
 {
-  int c = '\E';		/* { dg-warning "non-ISO" "non-ISO \\E" } */
-  c = L'\u00a0';	/* { dg-bogus "unknown" "\\u is known in C99" } */
+  int c = '\E';		/* { dg-warning "11:non-ISO" "non-ISO \\E" } */
+  c = L'\u00a0';	/* { dg-bogus "7:unknown" "\\u is known in C99" } */
 }
Index: gcc/testsuite/gcc.dg/cpp/escape.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/escape.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/escape.c	(working copy)
@@ -1,25 +1,25 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.  */
+/* Copyright (C) 2001, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do compile } */
-/* { dg-options "-Wtraditional -std=c89 -fno-show-column" } */
+/* { dg-options "-Wtraditional -std=c89" } */
 
 /* This tests various diagnostics with -Wtraditioanl about escape
    sequences, for both the preprocessor and the compiler.
 
    Neil Booth, 22 May 2001.  */
 
-#if '\a'		/* { dg-warning "traditional" "traditional bell" } */
+#if '\a'		/* { dg-warning "5:traditional" "traditional bell" } */
 #endif
-#if '\x1a' != 26	/* { dg-warning "traditional" "traditional hex" } */
+#if '\x1a' != 26	/* { dg-warning "5:traditional" "traditional hex" } */
  #error bad hex		/* { dg-bogus "bad" "bad hexadecimal evaluation" } */
 #endif
-#if L'\u00a1'		/* { dg-warning "only valid" "\u is unknown in C89" } */
+#if L'\u00a1'		/* { dg-warning "5:only valid" "\u is unknown in C89" } */
 #endif
 
 void foo ()
 {
-  int c = '\a';		/* { dg-warning "traditional" "traditional bell" } */
+  int c = '\a';		/* { dg-warning "11:traditional" "traditional bell" } */
 
-  c = '\xa1';		/* { dg-warning "traditional" "traditional hex" } */
-  c = L'\u00a1';	/* { dg-warning "only valid" "\u is unknown in C89" } */
+  c = '\xa1';		/* { dg-warning "7:traditional" "traditional hex" } */
+  c = L'\u00a1';	/* { dg-warning "7:only valid" "\u is unknown in C89" } */
 }
Index: gcc/testsuite/gcc.dg/cpp/empty-include.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/empty-include.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/empty-include.c	(working copy)
@@ -1,5 +1,5 @@
 /* 
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004, 2008 Free Software Foundation, Inc.
  * Contributed and written by Nathanael Nerode.
  *
  * GCC 3.4 would attempt to open stdin as the included file
@@ -9,5 +9,5 @@
  */
 
 /* { dg-do preprocess } */
-#include "" /* { dg-error "empty" "error on empty filename in include" } */
+#include "" /* { dg-error "10:empty" "error on empty filename in include" } */
 int x; /* Otherwise we have an empty file and get more errors. */
Index: gcc/testsuite/gcc.dg/cpp/assert2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/assert2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/assert2.c	(working copy)
@@ -1,24 +1,28 @@
 /* Malformed assertion tests.  */
 /* { dg-do preprocess } */
-/* { dg-options "-fno-show-column -Wno-deprecated" } */
+/* { dg-options "-Wno-deprecated" } */
 
-#assert		/* { dg-error "without predicate" "assert w/o predicate" } */
-#assert %	/* { dg-error "an identifier" "assert punctuation" } */
-#assert 12	/* { dg-error "an identifier" "assert number" } */
-#assert abc	/* { dg-error "missing" "assert w/o answer" } */
+#assert		/* { dg-error "1:without predicate" "assert w/o predicate" } */
+#assert %	/* { dg-error "9:an identifier" "assert punctuation" } */
+#assert 12	/* { dg-error "9:an identifier" "assert number" } */
+#assert abc	/* { dg-error "9:missing" "assert w/o answer" } */
 
-#if #		/* { dg-error "without predicate" "test w/o predicate" } */
+#if #		/* { dg-error "5:without predicate" "test w/o predicate" } */
 #endif
 
-#if #%		/* { dg-error "an identifier" "test punctuation" } */
+#if #%		/* { dg-error "6:an identifier" "test punctuation" } */
 #endif
 
-#if #12		/* { dg-error "an identifier" "test number" } */
+#if #12		/* { dg-error "6:an identifier" "test number" } */
 #endif
 
 #if #abc
 #error		/* { dg-bogus "error" "test w/o answer" } */
 #endif
 
-#if #abc[def]	/* { dg-error "is not valid" "test with malformed answer" } */
+#if #abc[def]	/* { dg-error "9:is not valid" "test with malformed answer" } */
 #endif
+
+#assert maude(23  /* { dg-error "15:to complete answer" "missing ')'" } */
+
+#assert lalala()  /* { dg-error "16:answer is empty" "empty answer" } */
Index: gcc/testsuite/gcc.dg/cpp/undef2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/undef2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/undef2.c	(working copy)
@@ -1,15 +1,13 @@
 /* C99 6.10.8 para 4: None of [the predefined macro names] shall be
-   the subject of a #define or an #undef preprocessing directive.  We
-   pass -fno-show-column as otherwise dejagnu gets confused.  */
+   the subject of a #define or an #undef preprocessing directive.  */
 
 /* { dg-do preprocess } */
-/* { dg-options "-fno-show-column" } */
 
-#undef __DATE__		/* { dg-warning "undefining" "__DATE__" } */
-#undef __TIME__		/* { dg-warning "undefining" "__TIME__" } */
-#undef __FILE__		/* { dg-warning "undefining" "__FILE__" } */
-#undef __LINE__		/* { dg-warning "undefining" "__LINE__" } */
-#undef __STDC__		/* { dg-warning "undefining" "__STDC__" } */
+#undef __DATE__		/* { dg-warning "8:undefining" "__DATE__" } */
+#undef __TIME__		/* { dg-warning "8:undefining" "__TIME__" } */
+#undef __FILE__		/* { dg-warning "8:undefining" "__FILE__" } */
+#undef __LINE__		/* { dg-warning "8:undefining" "__LINE__" } */
+#undef __STDC__		/* { dg-warning "8:undefining" "__STDC__" } */
 
 /* These should be protected from #undef, but aren't, because they
    are set with normal #define commands - and on top of that, some
Index: gcc/testsuite/gcc.dg/cpp/if-mop.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/if-mop.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/if-mop.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 
@@ -6,26 +6,26 @@
 
 /* Various illegal expressions with missing components.  */
 
-#if		/* { dg-error "no expression" "empty #if" } */
+#if		/* { dg-error "1:no expression" "empty #if" } */
 #endif
 
-#if ~		/* { dg-error "no right op" "no unary operand" } */
+#if ~		/* { dg-error "5:no right op" "no unary operand" } */
 #endif
 
-#if 3 + * 6 + 4  /* { dg-error "no right op" "no right operand" } */
+#if 3 + * 6 + 4  /* { dg-error "7:no right op" "no right operand" } */
 #endif
 
-#if 2 ~2	/* { dg-error "missing bin" "no binary operator" } */
+#if 2 ~2	/* { dg-error "7:missing bin" "no binary operator" } */
 #endif
 
-#if 1 + 2 (3)   /* { dg-error "missing bin" "immediate then open paren" } */
+#if 1 + 2 (3)   /* { dg-error "11:missing bin" "immediate then open paren" } */
 #endif
 
-#if (2) 4 * 2  /* { dg-error "missing bin" "close paren then immediate" } */
+#if (2) 4 * 2  /* { dg-error "9:missing bin" "close paren then immediate" } */
 #endif
 
-#if == 2  /* { dg-error "no left op" } */
+#if == 2  /* { dg-error "5:no left op" } */
 #endif
 
-#if (==2)  /* { dg-error "no left op" } */
+#if (==2)  /* { dg-error "6:no left op" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/if-1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/if-1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/if-1.c	(working copy)
@@ -9,33 +9,33 @@
 #error 077 != 63 /* { dg-bogus "#error" "normal conversion" } */
 #endif
 
-#if 12wrt /* { dg-error "invalid suffix" "invalid number" } */
+#if 12wrt /* { dg-error "5:invalid suffix" "invalid number" } */
 #endif
 
-#if 0abc /* { dg-error "invalid suffix" "invalid number" } */
+#if 0abc /* { dg-error "5:invalid suffix" "invalid number" } */
 #endif
 
-#if 42abc /* { dg-error "invalid suffix" "invalid number" } */
+#if 42abc /* { dg-error "5:invalid suffix" "invalid number" } */
 #endif
 
 #if 0xabc != 2748
 #error 0xabc	/* { dg-bogus "#error" "normal conversion" } */
 #endif
 
-#if 1.2 /* { dg-error "loating constant" "floating point in #if" } */
+#if 1.2 /* { dg-error "5:loating constant" "floating point in #if" } */
 #endif
 
-#if 4uu /* { dg-error "invalid suffix" "too many suffixes" } */
+#if 4uu /* { dg-error "5:invalid suffix" "too many suffixes" } */
 #endif
 
-#if 124123231lll /* { dg-error "invalid suffix" "too many suffixes" } */
+#if 124123231lll /* { dg-error "5:invalid suffix" "too many suffixes" } */
 #endif
 
-#if 1234lul	/* { dg-error "invalid suffix" "u between ls" } */
+#if 1234lul	/* { dg-error "5:invalid suffix" "u between ls" } */
 #endif
 
-#if 099 /* { dg-error "invalid digit" "decimal in octal constant" } */
+#if 099 /* { dg-error "5:invalid digit" "decimal in octal constant" } */
 #endif
 
-#if 0xfffffffffffffffff /* { dg-error "integer constant" "range error" } */
+#if 0xfffffffffffffffff /* { dg-error "5:integer constant" "range error" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/macspace2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/macspace2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/macspace2.c	(working copy)
@@ -1,63 +1,64 @@
 /* PR preprocessor/19475 */
 /* { dg-do preprocess } */
-/* { dg-options "-std=iso9899:1999 -pedantic-errors -fno-show-column" } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
 
-#define a!		/* { dg-error "requires whitespace" } */
-#define b"		/* { dg-error "requires whitespace" } */
-#define c#		/* { dg-error "requires whitespace" } */
-#define d%		/* { dg-error "requires whitespace" } */
-#define e&		/* { dg-error "requires whitespace" } */
-#define f'		/* { dg-error "requires whitespace" } */
-#define g)		/* { dg-error "requires whitespace" } */
-#define h*		/* { dg-error "requires whitespace" } */
-#define i+		/* { dg-error "requires whitespace" } */
-#define j,		/* { dg-error "requires whitespace" } */
-#define k-		/* { dg-error "requires whitespace" } */
-#define l.		/* { dg-error "requires whitespace" } */
-#define m/		/* { dg-error "requires whitespace" } */
-#define n:		/* { dg-error "requires whitespace" } */
-#define o;		/* { dg-error "requires whitespace" } */
-#define p<		/* { dg-error "requires whitespace" } */
-#define q=		/* { dg-error "requires whitespace" } */
-#define r>		/* { dg-error "requires whitespace" } */
-#define s?		/* { dg-error "requires whitespace" } */
-#define t[		/* { dg-error "requires whitespace" } */
-#define u]		/* { dg-error "requires whitespace" } */
-#define v^		/* { dg-error "requires whitespace" } */
-#define w{		/* { dg-error "requires whitespace" } */
-#define x|		/* { dg-error "requires whitespace" } */
-#define y}		/* { dg-error "requires whitespace" } */
-#define z~		/* { dg-error "requires whitespace" } */
-#define A>>		/* { dg-error "requires whitespace" } */
-#define B<<		/* { dg-error "requires whitespace" } */
-#define E&&		/* { dg-error "requires whitespace" } */
-#define F||		/* { dg-error "requires whitespace" } */
-#define G==		/* { dg-error "requires whitespace" } */
-#define H!=		/* { dg-error "requires whitespace" } */
-#define I>=		/* { dg-error "requires whitespace" } */
-#define J<=		/* { dg-error "requires whitespace" } */
-#define K+=		/* { dg-error "requires whitespace" } */
-#define L-=		/* { dg-error "requires whitespace" } */
-#define M*=		/* { dg-error "requires whitespace" } */
-#define N/=		/* { dg-error "requires whitespace" } */
-#define O%=		/* { dg-error "requires whitespace" } */
-#define P&=		/* { dg-error "requires whitespace" } */
-#define Q|=		/* { dg-error "requires whitespace" } */
-#define R^=		/* { dg-error "requires whitespace" } */
-#define S>>=		/* { dg-error "requires whitespace" } */
-#define T<<=		/* { dg-error "requires whitespace" } */
-#define W...		/* { dg-error "requires whitespace" } */
-#define X++		/* { dg-error "requires whitespace" } */
-#define Y--		/* { dg-error "requires whitespace" } */
-#define Z->		/* { dg-error "requires whitespace" } */
-#define aa::		/* { dg-error "requires whitespace" } */
-#define ab->*		/* { dg-error "requires whitespace" } */
-#define ac.*		/* { dg-error "requires whitespace" } */
-#define ad\x		/* { dg-error "requires whitespace" } */
-#define ae\\x		/* { dg-error "requires whitespace" } */
-#define af'1'		/* { dg-error "requires whitespace" } */
-#define ag"abc"		/* { dg-error "requires whitespace" } */
+#define a!		/* { dg-error "10:requires whitespace" } */
+/* Note: no tab characters on the next line.  */
+#define b"              /* { dg-error "10:requires whitespace" } */
+#define c#		/* { dg-error "10:requires whitespace" } */
+#define d%		/* { dg-error "10:requires whitespace" } */
+#define e&		/* { dg-error "10:requires whitespace" } */
+#define f'		/* { dg-error "10:requires whitespace" } */
+#define g)		/* { dg-error "10:requires whitespace" } */
+#define h*		/* { dg-error "10:requires whitespace" } */
+#define i+		/* { dg-error "10:requires whitespace" } */
+#define j,		/* { dg-error "10:requires whitespace" } */
+#define k-		/* { dg-error "10:requires whitespace" } */
+#define l.		/* { dg-error "10:requires whitespace" } */
+#define m/		/* { dg-error "10:requires whitespace" } */
+#define n:		/* { dg-error "10:requires whitespace" } */
+#define o;		/* { dg-error "10:requires whitespace" } */
+#define p<		/* { dg-error "10:requires whitespace" } */
+#define q=		/* { dg-error "10:requires whitespace" } */
+#define r>		/* { dg-error "10:requires whitespace" } */
+#define s?		/* { dg-error "10:requires whitespace" } */
+#define t[		/* { dg-error "10:requires whitespace" } */
+#define u]		/* { dg-error "10:requires whitespace" } */
+#define v^		/* { dg-error "10:requires whitespace" } */
+#define w{		/* { dg-error "10:requires whitespace" } */
+#define x|		/* { dg-error "10:requires whitespace" } */
+#define y}		/* { dg-error "10:requires whitespace" } */
+#define z~		/* { dg-error "10:requires whitespace" } */
+#define A>>		/* { dg-error "10:requires whitespace" } */
+#define B<<		/* { dg-error "10:requires whitespace" } */
+#define E&&		/* { dg-error "10:requires whitespace" } */
+#define F||		/* { dg-error "10:requires whitespace" } */
+#define G==		/* { dg-error "10:requires whitespace" } */
+#define H!=		/* { dg-error "10:requires whitespace" } */
+#define I>=		/* { dg-error "10:requires whitespace" } */
+#define J<=		/* { dg-error "10:requires whitespace" } */
+#define K+=		/* { dg-error "10:requires whitespace" } */
+#define L-=		/* { dg-error "10:requires whitespace" } */
+#define M*=		/* { dg-error "10:requires whitespace" } */
+#define N/=		/* { dg-error "10:requires whitespace" } */
+#define O%=		/* { dg-error "10:requires whitespace" } */
+#define P&=		/* { dg-error "10:requires whitespace" } */
+#define Q|=		/* { dg-error "10:requires whitespace" } */
+#define R^=		/* { dg-error "10:requires whitespace" } */
+#define S>>=		/* { dg-error "10:requires whitespace" } */
+#define T<<=		/* { dg-error "10:requires whitespace" } */
+#define W...		/* { dg-error "10:requires whitespace" } */
+#define X++		/* { dg-error "10:requires whitespace" } */
+#define Y--		/* { dg-error "10:requires whitespace" } */
+#define Z->		/* { dg-error "10:requires whitespace" } */
+#define aa::		/* { dg-error "11:requires whitespace" } */
+#define ab->*		/* { dg-error "11:requires whitespace" } */
+#define ac.*		/* { dg-error "11:requires whitespace" } */
+#define ad\x		/* { dg-error "11:requires whitespace" } */
+#define ae\\x		/* { dg-error "11:requires whitespace" } */
+#define af'1'		/* { dg-error "11:requires whitespace" } */
+#define ag"abc"		/* { dg-error "11:requires whitespace" } */
 
 int dummy;
-/* { dg-error "missing terminating" "" { target *-*-* } 6 } */
-/* { dg-error "missing terminating" "" { target *-*-* } 10 } */
+/* { dg-error "62:missing terminating" "" { target *-*-* } 7 } */
+/* { dg-error "missing terminating" "" { target *-*-* } 11 } */
Index: gcc/testsuite/gcc.dg/cpp/multiline-2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/multiline-2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/multiline-2.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2003, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do compile } */
 
Index: gcc/testsuite/gcc.dg/cpp/assembler.S
===================================================================
--- gcc/testsuite/gcc.dg/cpp/assembler.S	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/assembler.S	(working copy)
@@ -12,7 +12,7 @@
 
 /* Check we don't EOF on an unknown directive.  */
 #unknown directive
-#error a later diagnostic	/* { dg-error "diagnostic" } */
+#error a later diagnostic	/* { dg-error "2:diagnostic" } */
 		
 /*
    { dg-final { if ![file exists 20000510-1.i] { return }	} }
Index: gcc/testsuite/gcc.dg/cpp/paste1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/paste1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/paste1.c	(working copy)
@@ -1,10 +1,10 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 
 /* Test operator ## semantics.  */
 
-#define bad1 ## owt	/* { dg-error "cannot" "## at objlike start" } */
-#define bad2 owt ##	/* { dg-error "cannot" "## at objlike end" } */
-#define bad3(x) ## x	/* { dg-error "cannot" "## at funlike start" } */
-#define bad4(x) x ##	/* { dg-error "cannot" "## at funlike end" } */
+#define bad1 ## owt	/* { dg-error "14:cannot" "## at objlike start" } */
+#define bad2 owt ##	/* { dg-error "18:cannot" "## at objlike end" } */
+#define bad3(x) ## x	/* { dg-error "17:cannot" "## at funlike start" } */
+#define bad4(x) x ##	/* { dg-error "19:cannot" "## at funlike end" } */
Index: gcc/testsuite/gcc.dg/cpp/strify1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/strify1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/strify1.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 
@@ -6,5 +6,5 @@
 
 #define OK1 #		/* No problem.  */
 #define OK2(x) x#x	/* No problem.  */
-#define bad1(x) #	/* { dg-error "followed by a macro parameter" "#1" } */
-#define bad2(x) #y	/* { dg-error "followed by a macro parameter" "#2" } */
+#define bad1(x) #	/* { dg-error "17:followed by a macro parameter" "#1" } */
+#define bad2(x) #y	/* { dg-error "17:followed by a macro parameter" "#2" } */
Index: gcc/testsuite/gcc.dg/cpp/directiv.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/directiv.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/directiv.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 /* { dg-options -pedantic } */
@@ -8,7 +8,7 @@
 
 /* Test directive name is not expanded.  */
 #define foo define
-#foo EMPTY			/* { dg-error "invalid" } */
+#foo EMPTY			/* { dg-error "2:invalid" } */
 
 /* Test # must be first on line.  */
 EMPTY #define bar
@@ -18,8 +18,8 @@
 
 /* Test form feed and vertical tab warn pedantically, see 6.10
    paragraph 5.  Tab is OK.  */
-#\fdefine something		/* { dg-warning "form feed" } */
-#define \vsomething_else	/* { dg-warning "vertical tab" } */
+#\fdefine something		/* { dg-warning "2:form feed" } */
+#define \vsomething_else	/* { dg-warning "9:vertical tab" } */
 \f#define some	thing		/* Tab OK, as is form feed before #.  */
 
 /* Our friend the null directive OK?  */
@@ -31,5 +31,5 @@
    Note that the #if is still treated as a conditional, so there
    should be no errors about #endif without #if.  */
 #define func(x) x
-#if func (			/* { dg-error "unterminated argument" } */
+#if func (			/* { dg-error "10:unterminated argument" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/pr22168.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/pr22168.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/pr22168.c	(working copy)
@@ -3,10 +3,10 @@
 
 /* { dg-do preprocess }
    { dg-options -pedantic } */
-#if #foo(bar)    /* { dg-warning "GCC extension" } */
+#if #foo(bar)    /* { dg-warning "5:GCC extension" } */
 int x;
 #else
 int y;
 #endif
-#assert zzz(a)   /* { dg-warning "GCC extension" } */
-#unassert yyy    /* { dg-warning "GCC extension" } */
+#assert zzz(a)   /* { dg-warning "1:GCC extension" } */
+#unassert yyy    /* { dg-warning "1:GCC extension" } */
Index: gcc/testsuite/gcc.dg/cpp/if-2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/if-2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/if-2.c	(working copy)
@@ -18,11 +18,11 @@
 #endif
 
 /* The 'character constant (is )?too long' message is produced by 16-bit targets.  */
-#if 'abcd' /* { dg-warning "(multi-character character constant)|(character constant (is )?too long)" "multi-character charconst" } */
+#if 'abcd' /* { dg-warning "5:(multi-character character constant)|(character constant (is )?too long)" "multi-character charconst" } */
 #endif
 
-#if 'abcdefghi' /* { dg-warning "character constant (is )?too long" "charconst too long" } */
+#if 'abcdefghi' /* { dg-warning "5:character constant (is )?too long" "charconst too long" } */
 #endif
 
-#if '' /* { dg-error "empty character constant" "empty charconst" } */
+#if '' /* { dg-error "5:empty character constant" "empty charconst" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/defined.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/defined.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/defined.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 
@@ -6,7 +6,7 @@
 
 /*  Source: Neil Booth, 29 Oct 2000, Zack Weinberg 11 Dec 2000.  */
 
-#define defined			/* { dg-error "defined" } */
+#define defined			/* { dg-error "9:defined" } */
 
 /* No diagnostics, though you could argue there should be.  */
 #if defined defined
Index: gcc/testsuite/gcc.dg/cpp/19930510-1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/19930510-1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/19930510-1.c	(working copy)
@@ -3,5 +3,5 @@
 extern void exit (int);
 
 #define ugly 3
-#ugly "foobar" 3	/* { dg-error "invalid" "invalid directive" } */
+#ugly "foobar" 3	/* { dg-error "2:invalid" "invalid directive" } */
 int main() { exit (0); }
Index: gcc/testsuite/gcc.dg/cpp/tr-warn1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/tr-warn1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/tr-warn1.c	(working copy)
@@ -1,26 +1,26 @@
 /* Test for warnings about nontraditional directives.  */
 /* { dg-do preprocess } */
-/* { dg-options "-pedantic -Wtraditional -fno-show-column" } */
+/* { dg-options "-pedantic -Wtraditional" } */
 
 /* Block 1: K+R directives should have the # indented.  */
 
 #define foo bar		/* { dg-bogus "indented" "^#kandr"     } */
 # define foo bar	/* { dg-bogus "indented" "^# kandr"    } */
- #define foo bar	/* { dg-warning "indented" "^ #kandr"  } */
- # define foo bar	/* { dg-warning "indented" "^ # kandr" } */
+ #define foo bar	/* { dg-warning "2:indented" "^ #kandr"  } */
+ # define foo bar	/* { dg-warning "2:indented" "^ # kandr" } */
 
 /* Block 2: C89 directives should not have the # indented.  */
 
-#pragma whatever	/* { dg-warning "indented" "^#c89"     } */
-# pragma whatever	/* { dg-warning "indented" "^# c89"    } */
+#pragma whatever	/* { dg-warning "1:indented" "^#c89"     } */
+# pragma whatever	/* { dg-warning "1:indented" "^# c89"    } */
  #pragma whatever	/* { dg-bogus "indented" "^ #c89"      } */
  # pragma whatever	/* { dg-bogus "indented" "^ # c89"     } */
 
 /* Block 3: Extensions should not have the # indented,
    _and_ they should get a -pedantic warning. */
 
-#assert foo(bar)	/* { dg-warning "indented" "^#ext"    } */
-# assert bar(baz)	/* { dg-warning "indented" "^# ext"   } */
+#assert foo(bar)	/* { dg-warning "1:indented" "^#ext"    } */
+# assert bar(baz)	/* { dg-warning "1:indented" "^# ext"   } */
  #assert baz(quux)	/* { dg-bogus "indented" "^ #ext"     } */
  # assert quux(weeble)	/* { dg-bogus "indented" "^ # ext"    } */
 
@@ -28,9 +28,9 @@
    do not warn about indentaion.  */
 #if 0
 #if 1
-#elif 1			/* { dg-warning "#elif" "#elif skipping" }  */
+#elif 1			/* { dg-warning "1:#elif" "#elif skipping" }  */
 #endif
-#elif 0			/* { dg-warning "#elif" "#elif not skipping" }  */
+#elif 0			/* { dg-warning "1:#elif" "#elif not skipping" }  */
 #endif
 
 /* { dg-warning "GCC extension" "extension warning" { target *-*-* } 22 } */
Index: gcc/testsuite/gcc.dg/cpp/paste11.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/paste11.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/paste11.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 
@@ -9,7 +9,7 @@
 
 glue (ident, 12)		/* OK.  */
 glue (ident, 12e3)		/* OK.  */
-glue (ident, 12e+3)		/* { dg-error "valid preprocessing tok" } */
-glue (ident, 12e-3)		/* { dg-error "valid preprocessing tok" } */
-glue (ident, 1.2)		/* { dg-error "valid preprocessing tok" } */
-glue (ident, .12)		/* { dg-error "valid preprocessing tok" } */
+glue (ident, 12e+3)		/* { dg-error "1:valid preprocessing tok" } */
+glue (ident, 12e-3)		/* { dg-error "1:valid preprocessing tok" } */
+glue (ident, 1.2)		/* { dg-error "1:valid preprocessing tok" } */
+glue (ident, .12)		/* { dg-error "1:valid preprocessing tok" } */
Index: gcc/testsuite/gcc.dg/cpp/cxxcom1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/cxxcom1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/cxxcom1.c	(working copy)
@@ -2,7 +2,7 @@
 /* { dg-options "-pedantic -std=gnu89" } */
 
 /* You can't do this in your own code... */
-// C++ comment is not in C89  { dg-warning "style comment|reported only once" "good warning" }
+// C++ comment is not in C89  { dg-warning "1:style comment|reported only once" "good warning" }
 
 /* ...but we don't bitch about it more than once.  */
 // C++ comment is not in C89  { dg-bogus "style comment" "bad warning" }
Index: gcc/testsuite/gcc.dg/cpp/extratokens2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/extratokens2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/extratokens2.c	(working copy)
@@ -1,7 +1,7 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.  */
+/* Copyright (C) 2002, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
-/* { dg-options "-fno-show-column -Wno-endif-labels" } */
+/* { dg-options "-Wno-endif-labels" } */
 
 /* Tests that -Wno-endif-labels correctly disables the checks done by
    default (and tested in extratokens.c).  */
@@ -11,8 +11,8 @@
 
 #if 1 
 #if 0
-#else foo	/* { dg-bogus "extra tokens" "bad warning" } */
-#endif /	/* { dg-bogus "extra tokens" "bad warning" } */
+#else foo	/* { dg-bogus "7:extra tokens" "bad warning" } */
+#endif /	/* { dg-bogus "8:extra tokens" "bad warning" } */
 #endif
 
 # 36 "file.c" 3
Index: gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c	(working copy)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1990 -pedantic -Werror" } */
 
-#define f(x,...)	/* { dg-error "variadic" } */
-#define g(x,y...)	/* { dg-error "variadic" } */
+#define f(x,...)	/* { dg-error "13:variadic" } */
+#define g(x,y...)	/* { dg-error "14:variadic" } */
 int not_empty;
Index: gcc/testsuite/gcc.dg/cpp/c90-if-comma-1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/c90-if-comma-1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/c90-if-comma-1.c	(working copy)
@@ -4,8 +4,8 @@
 /* { dg-do preprocess } */
 /* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
 
-#if (1, 2) /* { dg-error "comma" "evaluated comma" } */
+#if (1, 2) /* { dg-error "7:comma" "evaluated comma" } */
 #endif
 
-#if 1 || (1, 2) /* { dg-error "comma" "unevaluated comma" } */
+#if 1 || (1, 2) /* { dg-error "12:comma" "unevaluated comma" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/Wsignprom.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/Wsignprom.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/Wsignprom.c	(working copy)
@@ -4,23 +4,23 @@
 /* Test that -Wall emits the warnings about integer promotion changing
    the sign of an operand.  */
 
-#if -1 > 0U  /* { dg-warning "changes sign when promoted" } */
+#if -1 > 0U  /* { dg-warning "8:changes sign when promoted" } */
 #endif
 
-#if 0U + -1  /* { dg-warning "changes sign when promoted" } */
+#if 0U + -1  /* { dg-warning "8:changes sign when promoted" } */
 #endif
 
-#if 0U * -1  /* { dg-warning "changes sign when promoted" } */
+#if 0U * -1  /* { dg-warning "8:changes sign when promoted" } */
 #endif
 
-#if 1U / -2  /* { dg-warning "changes sign when promoted" } */
+#if 1U / -2  /* { dg-warning "8:changes sign when promoted" } */
 #endif
 
-#if -1 % 1U  /* { dg-warning "changes sign when promoted" } */
+#if -1 % 1U  /* { dg-warning "8:changes sign when promoted" } */
 #endif
 
-#if 1 ? 0U : -1  /* { dg-warning "changes sign when promoted" } */
+#if 1 ? 0U : -1  /* { dg-warning "12:changes sign when promoted" } */
 #endif
 
-#if 1 ? -1 : 0U  /* { dg-warning "changes sign when promoted" } */
+#if 1 ? -1 : 0U  /* { dg-warning "12:changes sign when promoted" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/pr27777.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/pr27777.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/pr27777.c	(working copy)
@@ -4,5 +4,5 @@
 
 #error "BUG??!"
 
-/* { dg-error "BUG" "" { target *-*-* } 5 } */
-/* { dg-warning "trigraph" "" { target *-*-* } 5 } */
+/* { dg-error "2:BUG" "" { target *-*-* } 5 } */
+/* { dg-warning "12:trigraph" "" { target *-*-* } 5 } */
Index: gcc/testsuite/gcc.dg/cpp/redef2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/redef2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/redef2.c	(working copy)
@@ -1,7 +1,7 @@
 /* Test for redefining macros with significant differences.  */
 
 /* { dg-do preprocess }
-   { dg-options "-ansi -Wall -fno-show-column" } */
+   { dg-options "-ansi -Wall" } */
 
 #define mac(a, b) (a) + (b)
 #define mac(a, b) (a) * (b)
@@ -17,15 +17,15 @@
 #define foo(x) x
 #define foo(x)x		/* { dg-bogus "redefined" "redefined foo" } */
 
-/* { dg-warning "redefined" "redef mac"     { target *-*-* } 7  }
-   { dg-warning "redefined" "redef mac"     { target *-*-* } 8  }
-   { dg-warning "redefined" "redef mac"     { target *-*-* } 9  }
-   { dg-warning "redefined" "redef ro"      { target *-*-* } 12 }
-   { dg-warning "redefined" "redef va"      { target *-*-* } 15 }
+/* { dg-warning "9:redefined" "redef mac"     { target *-*-* } 7  }
+   { dg-warning "9:redefined" "redef mac"     { target *-*-* } 8  }
+   { dg-warning "9:redefined" "redef mac"     { target *-*-* } 9  }
+   { dg-warning "9:redefined" "redef ro"      { target *-*-* } 12 }
+   { dg-warning "9:redefined" "redef va"      { target *-*-* } 15 }
 
-   { dg-warning "previous"  "prev def mac"  { target *-*-* } 6  }
-   { dg-warning "previous"  "prev def mac"  { target *-*-* } 7  }
-   { dg-warning "previous"  "prev def mac"  { target *-*-* } 8  }
-   { dg-warning "previous"  "prev def ro"   { target *-*-* } 11 }
-   { dg-warning "previous"  "prev def va"   { target *-*-* } 14 }
+   { dg-warning "9:previous"  "prev def mac"  { target *-*-* } 6  }
+   { dg-warning "9:previous"  "prev def mac"  { target *-*-* } 7  }
+   { dg-warning "9:previous"  "prev def mac"  { target *-*-* } 8  }
+   { dg-warning "9:previous"  "prev def ro"   { target *-*-* } 11 }
+   { dg-warning "9:previous"  "prev def va"   { target *-*-* } 14 }
 */
Index: gcc/testsuite/gcc.dg/cpp/trad/assert2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/trad/assert2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/trad/assert2.c	(working copy)
@@ -2,23 +2,27 @@
 /* { dg-do preprocess } */
 /* { dg-options "-Wno-deprecated" } */
 
-#assert		/* { dg-error "without predicate" "assert w/o predicate" } */
-#assert %	/* { dg-error "an identifier" "assert punctuation" } */
-#assert 12	/* { dg-error "an identifier" "assert number" } */
-#assert abc	/* { dg-error "missing" "assert w/o answer" } */
+#assert		/* { dg-error "1:without predicate" "assert w/o predicate" } */
+#assert %	/* { dg-error "9:an identifier" "assert punctuation" } */
+#assert 12	/* { dg-error "9:an identifier" "assert number" } */
+#assert abc	/* { dg-error "9:missing" "assert w/o answer" } */
 
-#if #		/* { dg-error "without predicate" "test w/o predicate" } */
+#if #		/* { dg-error "5:without predicate" "test w/o predicate" } */
 #endif
 
-#if #%		/* { dg-error "an identifier" "test punctuation" } */
+#if #%		/* { dg-error "6:an identifier" "test punctuation" } */
 #endif
 
-#if #12		/* { dg-error "an identifier" "test number" } */
+#if #12		/* { dg-error "6:an identifier" "test number" } */
 #endif
 
 #if #abc
 #error		/* { dg-bogus "error" "test w/o answer" } */
 #endif
 
-#if #abc[def]	/* { dg-error "not valid in" "bad syntax" } */
+#if #abc[def]	/* { dg-error "9:not valid in" "bad syntax" } */
 #endif
+
+#assert maude(23  /* { dg-error "15:to complete answer" "missing ')'" } */
+
+#assert lalala()  /* { dg-error "16:answer is empty" "empty answer" } */
Index: gcc/testsuite/gcc.dg/cpp/trad/trad.exp
===================================================================
--- gcc/testsuite/gcc.dg/cpp/trad/trad.exp	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/trad/trad.exp	(working copy)
@@ -1,4 +1,4 @@
-#   Copyright (C) 1997, 2000, 2007 Free Software Foundation, Inc.
+#   Copyright (C) 1997, 2000, 2007, 2008 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@
 
 # Main loop.
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
-	"-fno-show-column" $DEFAULT_TRADCPPFLAGS
+	"" $DEFAULT_TRADCPPFLAGS
 
 # All done.
 dg-finish
Index: gcc/testsuite/gcc.dg/cpp/backslash2.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/backslash2.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/backslash2.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 
@@ -7,7 +7,7 @@
 
 foo \  
 bar
-/* { dg-warning "separated by space" "" { target *-*-* } 8 } */
+/* { dg-warning "5:separated by space" "" { target *-*-* } 8 } */
 
 /* foo \   
    bar */
Index: gcc/testsuite/gcc.dg/cpp/19951025-1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/19951025-1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/19951025-1.c	(working copy)
@@ -1,4 +1,4 @@
 /* { dg-do preprocess } */
-/* { dg-error "include expects" "include" { target *-*-* } 4 } */
-/* { dg-error "newline at end" "newline" { target *-*-* } 4 } */
+/* { dg-error "include expects" "10:include" { target *-*-* } 4 } */
+/* { dg-error "newline at end" "11:newline" { target *-*-* } 4 } */
 #include /\
Index: gcc/testsuite/gcc.dg/cpp/charconst-4.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/charconst-4.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/charconst-4.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.  */
+/* Copyright (C) 2001, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do run } */
 /* { dg-options "-Wno-multichar -fsigned-char" } */
@@ -38,7 +38,7 @@
 # error Charconst incorrectly sign-extended
 #endif
 
-#if LONG_CHARCONST != SHORT_CHARCONST /* { dg-warning "too long" "" } */
+#if LONG_CHARCONST != SHORT_CHARCONST /* { dg-warning "5:too long" "" } */
 # error Overly long charconst truncates wrongly for preprocessor
 #endif
 
@@ -46,7 +46,7 @@
 {
   if (POS_CHARCONST < 0)
     abort ();
-  if (LONG_CHARCONST != SHORT_CHARCONST)  /* { dg-warning "too long" "" } */
+  if (LONG_CHARCONST != SHORT_CHARCONST)  /* { dg-warning "7:too long" "" } */
     abort ();
   return 0;
 }
Index: gcc/testsuite/gcc.dg/cpp/dir-only-6.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/dir-only-6.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/dir-only-6.c	(working copy)
@@ -1,7 +1,7 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright 2007, 2008 Free Software Foundation, Inc.
    Contributed by Ollie Wild <aaw@google.com>.  */
 
 /* { dg-do preprocess } */
 /* { dg-options -fdirectives-only } */
 
-/* { dg-error "unterminated comment" }
+/* { dg-error "1:unterminated comment" }
Index: gcc/testsuite/gcc.dg/cpp/if-paren.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/if-paren.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/if-paren.c	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 
@@ -11,21 +11,21 @@
 #error		/* { dg-bogus "error" "without paren" } */
 #endif
 
-#if ()	        /* { dg-error "expression between" "empty paren" } */
+#if ()	        /* { dg-error "6:expression between" "empty paren" } */
 #endif
 
 #if (1) == 1
-#error		/* { dg-error "" "simple parens no. 1" } */
+#error		/* { dg-error "2:" "simple parens no. 1" } */
 #endif
 
 #if (2)
-#error		/* { dg-error "" "simple parens no. 2" } */
+#error		/* { dg-error "2:" "simple parens no. 2" } */
 #endif
 
 #if 3 == (3)
-#error		/* { dg-error "" "simple parens no. 3" } */
+#error		/* { dg-error "2:" "simple parens no. 3" } */
 #endif
 
 #if (((-1) + 8)) == ((+2) * ((3)) - -1)
-#error		/* { dg-error "" "nested parentheses" } */
+#error		/* { dg-error "2:" "nested parentheses" } */
 #endif
Index: gcc/testsuite/gcc.dg/cpp/extratokens.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/extratokens.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/extratokens.c	(working copy)
@@ -1,7 +1,7 @@
 /* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
-/* { dg-options "-fno-show-column -Wno-deprecated" } */
+/* { dg-options "-Wno-deprecated" } */
 
 /* Tests all directives that do not permit excess tokens at the end of
    the line.  */
@@ -9,27 +9,27 @@
 /* Source: Neil Booth, 4 Dec 2000.  The combination of separate test
    cases.  */
 
-#ifdef foo bar  /* { dg-warning "extra tokens" "tokens after #ifdef" } */
+#ifdef foo bar  /* { dg-warning "12:extra tokens" "tokens after #ifdef" } */
 #endif
 
-#ifndef foo bar  /* { dg-warning "extra tokens" "tokens after #ifndef" } */
+#ifndef foo bar  /* { dg-warning "13:extra tokens" "tokens after #ifndef" } */
 #endif
 
 #if 1 
 #if 0
-#else foo	/* { dg-warning "extra tokens" "tokens after #else" } */
-#endif /	/* { dg-warning "extra tokens" "tokens after #endif" } */
+#else foo	/* { dg-warning "7:extra tokens" "tokens after #else" } */
+#endif /	/* { dg-warning "8:extra tokens" "tokens after #endif" } */
 #endif
 
-#undef foo bar  /* { dg-warning "extra tokens" "tokens after #undef" } */
+#undef foo bar  /* { dg-warning "12:extra tokens" "tokens after #undef" } */
 
-#assert foo(bar) bar /* { dg-warning "extra tokens" "tokens after #assert" } */
+#assert foo(bar) bar /* { dg-warning "18:extra tokens" "tokens after #assert" } */
 
-#unassert foo(bar) b /* { dg-warning "extra tokens" "tokens after #unassert" } */
+#unassert foo(bar) b /* { dg-warning "20:extra tokens" "tokens after #unassert" } */
 
-#include "mi1c.h" bar /* { dg-warning "extra tokens" "tokens after #include" } */
+#include "mi1c.h" bar /* { dg-warning "19:extra tokens" "tokens after #include" } */
 
-#ident "something" bar /* { dg-warning "extra tokens" "tokens after #ident" } */
+#ident "something" bar /* { dg-warning "20:extra tokens" "tokens after #ident" } */
 
 # 36 "file.c" 3
 
Index: gcc/testsuite/gcc.dg/cpp/pr29612-1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/pr29612-1.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/pr29612-1.c	(working copy)
@@ -4,7 +4,7 @@
 
 # 6 "pr29612-1.c"
 
-int foo (void) { return 'ab'; } /* { dg-warning "multi-character" } */
+int foo (void) { return 'ab'; } /* { dg-warning "25:multi-character" } */
 
 # 1 "foo.h" 1 3
 
@@ -12,4 +12,4 @@
 
 # 14 "pr29612-1.c" 2
 
-int baz (void) { return 'ab'; } /* { dg-warning "multi-character" } */
+int baz (void) { return 'ab'; } /* { dg-warning "25:multi-character" } */
Index: gcc/testsuite/gcc.dg/cpp/if-mpar.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/if-mpar.c	(revision 140858)
+++ gcc/testsuite/gcc.dg/cpp/if-mpar.c	(working copy)
@@ -1,24 +1,24 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc.  */
 
 /* Test various combinations of missing parentheses give the correct
    missing parenthesis message.  */
 
 /* { dg-do preprocess } */
 
-#if (1          /* { dg-error "missing '\\)'" "missing ')' no. 1" } */
+#if (1          /* { dg-error "5:missing '\\)'" "missing ')' no. 1" } */
 #endif
 
-#if 2 * (3 + 4	/* { dg-error "missing '\\)'" "missing ')' no. 2" } */
+#if 2 * (3 + 4	/* { dg-error "9:missing '\\)'" "missing ')' no. 2" } */
 #endif
 
-#if (2))	/* { dg-error "missing '\\('" "missing '(' no. 1" } */
+#if (2))	/* { dg-error "8:missing '\\('" "missing '(' no. 1" } */
 #endif
 
-#if )		/* { dg-error "missing '\\('" "missing '(' no. 2" } */
+#if )		/* { dg-error "5:missing '\\('" "missing '(' no. 2" } */
 #endif
 
-#if 4)		/* { dg-error "missing '\\('" "missing '(' no. 3" } */
+#if 4)		/* { dg-error "6:missing '\\('" "missing '(' no. 3" } */
 #endif
 
-#if (		/* { dg-error "missing '\\)'" "missing ')' no. 3" } */
+#if (		/* { dg-error "5:missing '\\)'" "missing ')' no. 3" } */
 #endif
Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog	(revision 140858)
+++ gcc/testsuite/ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+<<<<<<< .mine
+2008-08-28  Tom Tromey  <tromey@redhat.com>
+
+	* gcc.dg/cpp/trad/assert2.c: Add assertion tests.
+	* gcc.dg/cpp/paste15.c: Add column numbers.
+	* gcc.dg/cpp/cpp.exp: Don't pass -fno-show-column.
+
+=======
 2008-10-03  Jakub Jelinek  <jakub@redhat.com>
 
 	PR debug/37726
@@ -2492,6 +2500,7 @@
 	* gcc.dg/ipa/ipa-5.c: Add -fipa-cp-clone
 	* gcc.dg/ipa/ipa-7.c: Add -fipa-cp-clone
 
+>>>>>>> .r140858
 2008-08-27  Paolo Carlini  <paolo.carlini@oracle.com>
 
 	PR c++/35321
Index: gcc/testsuite/lib/gcc-dg.exp
===================================================================
--- gcc/testsuite/lib/gcc-dg.exp	(revision 140858)
+++ gcc/testsuite/lib/gcc-dg.exp	(working copy)
@@ -613,6 +613,19 @@
     }
 }
 
+if { [info procs saved-dg-bogus] == [list] \
+     && [info exists gcc_error_prefix] } {
+    rename dg-bogus saved-dg-bogus
+
+    proc dg-bogus { args } {
+	# Make this variable available here and to the saved proc.
+	upvar dg-messages dg-messages
+	global gcc_error_prefix
+
+	process-message saved-dg-bogus "$gcc_error_prefix" "$args"
+    }
+}
+
 # Modify the regular expression saved by a DejaGnu message directive to
 # include a prefix and to force the expression to match a single line.
 # MSGPROC is the procedure to call.
@@ -645,7 +658,11 @@
 	# Include the column in the search expression.
 	set expmsg "$column: $msgprefix\[^\n]*$expmsg"
     } else {
-	set expmsg "$msgprefix\[^\n]*$expmsg"
+        # Note that we must ignore columns if they exist.  Otherwise,
+	# a dg-bogus (which by its nature should not have a column
+	# number) can fail if there is a message whose column happens
+	# to be the same as the line number expected by the dg-bogus.
+        set expmsg "(\[0-9\]+: )?$msgprefix\[^\n]*$expmsg"
     }
 
     set newentry [lreplace $newentry 2 2 $expmsg]
Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c	(revision 140858)
+++ gcc/dwarf2out.c	(working copy)
@@ -5163,6 +5163,9 @@
 #ifndef DEBUG_PUBNAMES_SECTION
 #define DEBUG_PUBNAMES_SECTION	".debug_pubnames"
 #endif
+#ifndef DEBUG_PUBTYPES_SECTION
+#define DEBUG_PUBTYPES_SECTION	".debug_pubtypes"
+#endif
 #ifndef DEBUG_STR_SECTION
 #define DEBUG_STR_SECTION	".debug_str"
 #endif
Index: gcc/config/linux.h
===================================================================
--- gcc/config/linux.h	(revision 140858)
+++ gcc/config/linux.h	(working copy)
@@ -1,6 +1,6 @@
 /* Definitions for Linux-based GNU systems with ELF format
    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006,
-   2007 Free Software Foundation, Inc.
+   2007, 2008 Free Software Foundation, Inc.
    Contributed by Eric Youngdale.
    Modified for stabs-in-ELF by H.J. Lu (hjl@lucon.org).
 
@@ -130,3 +130,5 @@
 #define TARGET_HAS_SINCOS (OPTION_GLIBC)
 
 #define TARGET_POSIX_IO
+
+#define DEBUG_PUBTYPES_SECTION	".debug_pubtypes"
Index: libcpp/macro.c
===================================================================
--- libcpp/macro.c	(revision 140858)
+++ libcpp/macro.c	(working copy)
@@ -67,7 +67,7 @@
 static cpp_token *lex_expansion_token (cpp_reader *, cpp_macro *);
 static bool warn_of_redefinition (cpp_reader *, const cpp_hashnode *,
 				  const cpp_macro *);
-static bool parse_params (cpp_reader *, cpp_macro *);
+static bool parse_params (cpp_reader *, cpp_macro *, source_location);
 static void check_trad_stringification (cpp_reader *, const cpp_macro *,
 					const cpp_string *);
 
@@ -1476,9 +1476,10 @@
 }
 
 /* Check the syntax of the parameters in a MACRO definition.  Returns
-   false if an error occurs.  */
+   false if an error occurs.  LOCATION is the location of the open
+   paren.  */
 static bool
-parse_params (cpp_reader *pfile, cpp_macro *macro)
+parse_params (cpp_reader *pfile, cpp_macro *macro, source_location location)
 {
   unsigned int prev_ident = 0;
 
@@ -1549,10 +1550,15 @@
 	  token = _cpp_lex_token (pfile);
 	  if (token->type == CPP_CLOSE_PAREN)
 	    return true;
+
+	  /* Put the error on the token after the ellipsis in this
+	     case.  */
+	  location = token->src_loc;
 	  /* Fall through.  */
 
 	case CPP_EOF:
-	  cpp_error (pfile, CPP_DL_ERROR, "missing ')' in macro parameter list");
+	  cpp_error_with_line (pfile, CPP_DL_ERROR, location, 0,
+			       "missing ')' in macro parameter list");
 	  return false;
 	}
     }
@@ -1600,6 +1606,7 @@
   cpp_token *token;
   const cpp_token *ctoken;
   bool following_paste_op = false;
+  source_location previous_location;
   const char *paste_op_error_msg =
     N_("'##' cannot appear at either end of a macro expansion");
 
@@ -1609,7 +1616,7 @@
 
   if (ctoken->type == CPP_OPEN_PAREN && !(ctoken->flags & PREV_WHITE))
     {
-      bool ok = parse_params (pfile, macro);
+      bool ok = parse_params (pfile, macro, ctoken->src_loc);
       macro->params = (cpp_hashnode **) BUFF_FRONT (pfile->a_buff);
       if (!ok)
 	return false;
@@ -1688,8 +1695,8 @@
 	  /* Let assembler get away with murder.  */
 	  else if (CPP_OPTION (pfile, lang) != CLK_ASM)
 	    {
-	      cpp_error (pfile, CPP_DL_ERROR,
-			 "'#' is not followed by a macro parameter");
+	      cpp_error_with_line (pfile, CPP_DL_ERROR, token[-1].src_loc, 0,
+				   "'#' is not followed by a macro parameter");
 	      return false;
 	    }
 	}
@@ -1701,7 +1708,8 @@
 	     function-like macros, but not at the end.  */
 	  if (following_paste_op)
 	    {
-	      cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg);
+	      cpp_error_with_line (pfile, CPP_DL_ERROR, previous_location, 0,
+				   paste_op_error_msg);
 	      return false;
 	    }
 	  break;
@@ -1714,7 +1722,8 @@
 	     function-like macros, but not at the beginning.  */
 	  if (macro->count == 1)
 	    {
-	      cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg);
+	      cpp_error_with_line (pfile, CPP_DL_ERROR, token->src_loc, 0,
+				   paste_op_error_msg);
 	      return false;
 	    }
 
@@ -1723,6 +1732,7 @@
 	}
 
       following_paste_op = (token->type == CPP_PASTE);
+      previous_location = token->src_loc;
       token = lex_expansion_token (pfile, macro);
     }
 
@@ -1753,7 +1763,8 @@
 
 /* Parse a macro and save its expansion.  Returns nonzero on success.  */
 bool
-_cpp_create_definition (cpp_reader *pfile, cpp_hashnode *node)
+_cpp_create_definition (cpp_reader *pfile, cpp_hashnode *node,
+			source_location location)
 {
   cpp_macro *macro;
   unsigned int i;
@@ -1764,7 +1775,7 @@
       (sizeof (cpp_macro));
   else
     macro = (cpp_macro *) _cpp_aligned_alloc (pfile, sizeof (cpp_macro));
-  macro->line = pfile->directive_line;
+  macro->line = location;
   macro->params = 0;
   macro->paramc = 0;
   macro->variadic = 0;
@@ -1807,7 +1818,7 @@
 
       if (warn_of_redefinition (pfile, node, macro))
 	{
-	  cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->directive_line, 0,
+	  cpp_error_with_line (pfile, CPP_DL_PEDWARN, macro->line, 0,
 			       "\"%s\" redefined", NODE_NAME (node));
 
 	  if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN))
Index: libcpp/directives.c
===================================================================
--- libcpp/directives.c	(revision 140858)
+++ libcpp/directives.c	(working copy)
@@ -93,18 +93,20 @@
 
 static void skip_rest_of_line (cpp_reader *);
 static void check_eol (cpp_reader *);
-static void start_directive (cpp_reader *);
+static void start_directive (cpp_reader *, source_location);
 static void prepare_directive_trad (cpp_reader *);
 static void end_directive (cpp_reader *, int);
-static void directive_diagnostics (cpp_reader *, const directive *, int);
+static void directive_diagnostics (cpp_reader *, const directive *, int,
+				   source_location);
 static void run_directive (cpp_reader *, int, const char *, size_t);
-static char *glue_header_name (cpp_reader *);
-static const char *parse_include (cpp_reader *, int *, const cpp_token ***);
+static char *glue_header_name (cpp_reader *, source_location *);
+static const char *parse_include (cpp_reader *, int *, const cpp_token ***,
+				  source_location *);
 static void push_conditional (cpp_reader *, int, int, const cpp_hashnode *);
 static unsigned int read_flag (cpp_reader *, unsigned int);
 static bool strtolinenum (const uchar *, size_t, linenum_type *, bool *);
 static void do_diagnostic (cpp_reader *, int, int);
-static cpp_hashnode *lex_macro_node (cpp_reader *, bool);
+static const cpp_token *lex_macro_node (cpp_reader *, bool);
 static int undefine_macros (cpp_reader *, cpp_hashnode *, void *);
 static void do_include_common (cpp_reader *, enum include_type);
 static struct pragma_entry *lookup_pragma_entry (struct pragma_entry *,
@@ -120,9 +122,11 @@
 static void do_linemarker (cpp_reader *);
 static const cpp_token *get_token_no_padding (cpp_reader *);
 static const cpp_token *get__Pragma_string (cpp_reader *);
-static void destringize_and_run (cpp_reader *, const cpp_string *);
-static int parse_answer (cpp_reader *, struct answer **, int);
-static cpp_hashnode *parse_assertion (cpp_reader *, struct answer **, int);
+static void destringize_and_run (cpp_reader *, const cpp_string *,
+				 unsigned int, source_location);
+static int parse_answer (cpp_reader *, source_location, struct answer **, int);
+static cpp_hashnode *parse_assertion (cpp_reader *, source_location,
+				      struct answer **, int);
 static struct answer ** find_answer (cpp_hashnode *, const struct answer *);
 static void handle_assertion (cpp_reader *, const char *, int);
 
@@ -257,9 +261,12 @@
   return buf;
 }
 
-/* Called when entering a directive, _Pragma or command-line directive.  */
+/* Called when entering a directive, _Pragma or command-line
+   directive.  LOC is the location of the directive, used by some
+   handlers for diagnostics.  If zero, the line table's highest line
+   is used instead.  */
 static void
-start_directive (cpp_reader *pfile)
+start_directive (cpp_reader *pfile, source_location loc)
 {
   /* Setup in-directive state.  */
   pfile->state.in_directive = 1;
@@ -267,7 +274,7 @@
   pfile->directive_result.type = CPP_PADDING;
 
   /* Some handlers need the position of the # for diagnostics.  */
-  pfile->directive_line = pfile->line_table->highest_line;
+  pfile->directive_line = loc ? loc : pfile->line_table->highest_line;
 }
 
 /* Called when leaving a directive, _Pragma or command-line directive.  */
@@ -309,6 +316,13 @@
 {
   if (pfile->directive != &dtable[T_DEFINE])
     {
+      /* Save the current highest line.  */
+/*       struct line_map *saved_map */
+/* 	= &pfile->line_table->maps[pfile->line_table->used - 1]; */
+/*       struct line_map *map; */
+/*       linenum_type saved_max_line */
+/* 	= SOURCE_LINE (saved_map, pfile->line_table->highest_line); */
+
       bool no_expand = (pfile->directive
 			&& ! (pfile->directive->flags & EXPAND));
       bool was_skipping = pfile->state.skipping;
@@ -321,6 +335,11 @@
       if (no_expand)
 	pfile->state.prevent_expansion++;
       _cpp_scan_out_logical_line (pfile, NULL);
+
+/*       map = &pfile->line_table->maps[pfile->line_table->used - 1]; */
+/*       if (SOURCE_LINE (map, pfile->line_table->highest_line) != saved_max_line) */
+/* 	linemap_line_start (pfile->line_table, saved_max_line, 0); */
+
       if (no_expand)
 	pfile->state.prevent_expansion--;
 
@@ -334,9 +353,10 @@
 }
 
 /* Output diagnostics for a directive DIR.  INDENTED is nonzero if
-   the '#' was indented.  */
+   the '#' was indented.  HASH_LOC is the location of the '#' token.  */
 static void
-directive_diagnostics (cpp_reader *pfile, const directive *dir, int indented)
+directive_diagnostics (cpp_reader *pfile, const directive *dir, int indented,
+		       source_location hash_loc)
 {
   /* Issue -pedantic or deprecated warnings for extensions.  We let
      -pedantic take precedence if both are applicable.  */
@@ -345,12 +365,14 @@
       if (dir->origin == EXTENSION
 	  && !(dir == &dtable[T_IMPORT] && CPP_OPTION (pfile, objc))
 	  && CPP_PEDANTIC (pfile))
-	cpp_error (pfile, CPP_DL_PEDWARN, "#%s is a GCC extension", dir->name);
+	cpp_error_with_line (pfile, CPP_DL_PEDWARN, hash_loc, 0,
+			     "#%s is a GCC extension", dir->name);
       else if (((dir->flags & DEPRECATED) != 0
 		|| (dir == &dtable[T_IMPORT] && !CPP_OPTION (pfile, objc)))
 	       && CPP_OPTION (pfile, warn_deprecated))
-	cpp_error (pfile, CPP_DL_WARNING, "#%s is a deprecated GCC extension",
-		   dir->name);
+	cpp_error_with_line (pfile, CPP_DL_WARNING, hash_loc, 0,
+			     "#%s is a deprecated GCC extension",
+			     dir->name);
     }
 
   /* Traditionally, a directive is ignored unless its # is in
@@ -362,16 +384,16 @@
   if (CPP_WTRADITIONAL (pfile))
     {
       if (dir == &dtable[T_ELIF])
-	cpp_error (pfile, CPP_DL_WARNING,
-		   "suggest not using #elif in traditional C");
+	cpp_error_with_line (pfile, CPP_DL_WARNING, hash_loc, 0,
+			     "suggest not using #elif in traditional C");
       else if (indented && dir->origin == KANDR)
-	cpp_error (pfile, CPP_DL_WARNING,
-		   "traditional C ignores #%s with the # indented",
-		   dir->name);
+	cpp_error_with_line (pfile, CPP_DL_WARNING, hash_loc, 0,
+			     "traditional C ignores #%s with the # indented",
+			     dir->name);
       else if (!indented && dir->origin != KANDR)
-	cpp_error (pfile, CPP_DL_WARNING,
-		   "suggest hiding #%s from traditional C with an indented #",
-		   dir->name);
+	cpp_error_with_line (pfile, CPP_DL_WARNING, hash_loc, 0,
+			     "suggest hiding #%s from traditional C with an indented #",
+			     dir->name);
     }
 }
 
@@ -388,6 +410,7 @@
   bool was_parsing_args = pfile->state.parsing_args;
   bool was_discarding_output = pfile->state.discarding_output;
   int skip = 1;
+  source_location hash_location = pfile->line_table->highest_location;
 
   if (was_discarding_output)
     pfile->state.prevent_expansion = 0;
@@ -400,7 +423,7 @@
       pfile->state.parsing_args = 0;
       pfile->state.prevent_expansion = 0;
     }
-  start_directive (pfile);
+  start_directive (pfile, 0);
   dname = _cpp_lex_token (pfile);
 
   if (dname->type == CPP_NAME)
@@ -455,7 +478,7 @@
 	  pfile->state.angled_headers = dir->flags & INCL;
 	  pfile->state.directive_wants_padding = dir->flags & INCL;
 	  if (! CPP_OPTION (pfile, preprocessed))
-	    directive_diagnostics (pfile, dir, indented);
+	    directive_diagnostics (pfile, dir, indented, hash_location);
 	  if (pfile->state.skipping && !(dir->flags & COND))
 	    dir = 0;
 	}
@@ -503,7 +526,7 @@
 {
   cpp_push_buffer (pfile, (const uchar *) buf, count,
 		   /* from_stage3 */ true);
-  start_directive (pfile);
+  start_directive (pfile, 0);
 
   /* This is a short-term fix to prevent a leading '#' being
      interpreted as a directive.  */
@@ -521,7 +544,7 @@
    #ifndef directives.  IS_DEF_OR_UNDEF is true if this call is
    processing a #define or #undefine directive, and false
    otherwise.  */
-static cpp_hashnode *
+static const cpp_token *
 lex_macro_node (cpp_reader *pfile, bool is_def_or_undef)
 {
   const cpp_token *token = _cpp_lex_token (pfile);
@@ -541,7 +564,7 @@
 	cpp_error (pfile, CPP_DL_ERROR,
 		   "\"defined\" cannot be used as a macro name");
       else if (! (node->flags & NODE_POISONED))
-	return node;
+	return token;
     }
   else if (token->flags & NAMED_OP)
     cpp_error (pfile, CPP_DL_ERROR,
@@ -560,10 +583,12 @@
 static void
 do_define (cpp_reader *pfile)
 {
-  cpp_hashnode *node = lex_macro_node (pfile, true);
+  const cpp_token *token = lex_macro_node (pfile, true);
 
-  if (node)
+  if (token)
     {
+      cpp_hashnode *node = token->val.node;
+
       /* If we have been requested to expand comments into macros,
 	 then re-enable saving of comments.  */
       pfile->state.save_comments =
@@ -572,7 +597,7 @@
       if (pfile->cb.before_define)
 	pfile->cb.before_define (pfile);
 
-      if (_cpp_create_definition (pfile, node))
+      if (_cpp_create_definition (pfile, node, token->src_loc))
 	if (pfile->cb.define)
 	  pfile->cb.define (pfile, pfile->directive_line, node);
 
@@ -584,10 +609,12 @@
 static void
 do_undef (cpp_reader *pfile)
 {
-  cpp_hashnode *node = lex_macro_node (pfile, true);
+  const cpp_token *token = lex_macro_node (pfile, true);
 
-  if (node)
+  if (token)
     {
+      cpp_hashnode *node = token->val.node;
+
       if (pfile->cb.before_define)
 	pfile->cb.before_define (pfile);
 
@@ -636,9 +663,10 @@
 
 /* Helper routine used by parse_include.  Reinterpret the current line
    as an h-char-sequence (< ... >); we are looking at the first token
-   after the <.  Returns a malloced filename.  */
+   after the <.  Returns a malloced filename.  *LOCATION is set to a
+   location suitable for diagnostics.  */
 static char *
-glue_header_name (cpp_reader *pfile)
+glue_header_name (cpp_reader *pfile, source_location *location)
 {
   const cpp_token *token;
   char *buffer;
@@ -651,6 +679,9 @@
     {
       token = get_token_no_padding (pfile);
 
+      if (!total_len)
+	*location = token->src_loc;
+
       if (token->type == CPP_GREATER)
 	break;
       if (token->type == CPP_EOF)
@@ -680,10 +711,11 @@
 
 /* Returns the file name of #include, #include_next, #import and
    #pragma dependency.  The string is malloced and the caller should
-   free it.  Returns NULL on error.  */
+   free it.  Returns NULL on error.  *LOCATION is set to the location
+   at which diagnostics should be emitted.  */
 static const char *
 parse_include (cpp_reader *pfile, int *pangle_brackets,
-	       const cpp_token ***buf)
+	       const cpp_token ***buf, source_location *location)
 {
   char *fname;
   const cpp_token *header;
@@ -696,10 +728,11 @@
       memcpy (fname, header->val.str.text + 1, header->val.str.len - 2);
       fname[header->val.str.len - 2] = '\0';
       *pangle_brackets = header->type == CPP_HEADER_NAME;
+      *location = header->src_loc;
     }
   else if (header->type == CPP_LESS)
     {
-      fname = glue_header_name (pfile);
+      fname = glue_header_name (pfile, location);
       *pangle_brackets = 1;
     }
   else
@@ -739,12 +772,13 @@
   const char *fname;
   int angle_brackets;
   const cpp_token **buf = NULL;
+  source_location err_loc;
 
   /* Re-enable saving of comments if requested, so that the include
      callback can dump comments which follow #include.  */
   pfile->state.save_comments = ! CPP_OPTION (pfile, discard_comments);
 
-  fname = parse_include (pfile, &angle_brackets, &buf);
+  fname = parse_include (pfile, &angle_brackets, &buf, &err_loc);
   if (!fname)
     {
       if (buf)
@@ -754,8 +788,9 @@
 
   if (!*fname)
   {
-    cpp_error (pfile, CPP_DL_ERROR, "empty filename in #%s",
-               pfile->directive->name);
+    cpp_error_with_line (pfile, CPP_DL_ERROR, err_loc, 0,
+			 "empty filename in #%s",
+			 pfile->directive->name);
     XDELETEVEC (fname);
     if (buf)
       XDELETEVEC (buf);
@@ -764,7 +799,8 @@
 
   /* Prevent #include recursion.  */
   if (pfile->line_table->depth >= CPP_STACK_MAX)
-    cpp_error (pfile, CPP_DL_ERROR, "#include nested too deeply");
+    cpp_error_with_line (pfile, CPP_DL_ERROR, pfile->directive_line, 0,
+			 "#include nested too deeply");
   else
     {
       /* Get out of macro context, if we are.  */
@@ -1467,18 +1503,20 @@
 {
   const char *fname;
   int angle_brackets, ordering;
+  source_location err_loc;
 
-  fname = parse_include (pfile, &angle_brackets, NULL);
+  fname = parse_include (pfile, &angle_brackets, NULL, &err_loc);
   if (!fname)
     return;
 
   ordering = _cpp_compare_file_date (pfile, fname, angle_brackets);
   if (ordering < 0)
-    cpp_error (pfile, CPP_DL_WARNING, "cannot find source file %s", fname);
+    cpp_error_with_line (pfile, CPP_DL_WARNING, err_loc, 0,
+			 "cannot find source file %s", fname);
   else if (ordering > 0)
     {
-      cpp_error (pfile, CPP_DL_WARNING,
-		 "current file is older than %s", fname);
+      cpp_error_with_line (pfile, CPP_DL_WARNING, err_loc, 0,
+			   "current file is older than %s", fname);
       if (cpp_get_token (pfile)->type != CPP_EOF)
 	{
 	  _cpp_backup_tokens (pfile, 1);
@@ -1532,9 +1570,14 @@
 }
 
 /* Destringize IN into a temporary buffer, by removing the first \ of
-   \" and \\ sequences, and process the result as a #pragma directive.  */
+   \" and \\ sequences, and process the result as a #pragma directive.
+   START_COLUMN is the starting column of the string.
+   DIRECTIVE_LOCATION is the location of the directive itself, for
+   error-reporting purposes.  */
 static void
-destringize_and_run (cpp_reader *pfile, const cpp_string *in)
+destringize_and_run (cpp_reader *pfile, const cpp_string *in,
+		     unsigned int start_column,
+		     source_location directive_location)
 {
   const unsigned char *src, *limit;
   char *dest, *result;
@@ -1545,7 +1588,12 @@
   int count;
   const struct directive *save_directive;
 
-  dest = result = (char *) alloca (in->len - 1);
+  dest = result = (char *) alloca (start_column + in->len - 1);
+
+  /* Skip over to the correct starting column.  */
+  while (start_column--)
+    *dest++ = ' ';
+
   src = in->text + 1 + (in->text[0] == 'L');
   limit = in->text + in->len - 1;
   while (src < limit)
@@ -1582,7 +1630,7 @@
   if (pfile->buffer->prev)
     pfile->buffer->file = pfile->buffer->prev->file;
 
-  start_directive (pfile);
+  start_directive (pfile, directive_location);
   _cpp_clean_line (pfile);
   save_directive = pfile->directive;
   pfile->directive = &dtable[T_PRAGMA];
@@ -1658,7 +1706,39 @@
 
   if (string)
     {
-      destringize_and_run (pfile, &string->val.str);
+      struct line_maps *line_table = pfile->line_table;
+
+      /* Save the current highest line.  */
+      struct line_map *saved_map = &line_table->maps[line_table->used - 1];
+      linenum_type saved_max_line = SOURCE_LINE (saved_map,
+						 line_table->highest_line);
+
+      const struct line_map *map = linemap_lookup (line_table, string->src_loc);
+      unsigned int column = SOURCE_COLUMN (map, string->src_loc);
+      source_location dir_loc;
+
+      /* Go "back" to the string's line, so that error messages can be
+	 reported properly.  */
+      linemap_line_start (line_table, SOURCE_LINE (map, string->src_loc), 0);
+
+      /* Set the directive's location properly for pragma handlers.
+	 The logic here is a bit funny -- at this point, we know that
+	 no context for the _Pragma has been pushed.  So, if the
+	 current context came from a macro, it is some outer macro
+	 whose expansion has a _Pragma.  In this case we want to the
+	 directive to use the invocation location of the macro, if
+	 that exists.  Otherwise, the directive should just use the
+	 location of the _Pragma's argument.  */
+      if (pfile->context->macro && pfile->invocation_location)
+	dir_loc = pfile->invocation_location;
+      else
+	LINEMAP_POSITION_FOR_COLUMN (dir_loc, line_table, column);
+
+      destringize_and_run (pfile, &string->val.str, column, dir_loc);
+
+      /* Now return to the saved line.  */
+      linemap_line_start (line_table, saved_max_line, 0);
+
       return 1;
     }
   cpp_error (pfile, CPP_DL_ERROR,
@@ -1674,10 +1754,12 @@
 
   if (! pfile->state.skipping)
     {
-      cpp_hashnode *node = lex_macro_node (pfile, false);
+      const cpp_token *token = lex_macro_node (pfile, false);
 
-      if (node)
+      if (token)
 	{
+	  cpp_hashnode *node = token->val.node;
+
 	  skip = node->type != NT_MACRO;
 	  _cpp_mark_macro_used (node);
 	  if (!(node->flags & NODE_USED))
@@ -1710,10 +1792,12 @@
 
   if (! pfile->state.skipping)
     {
-      node = lex_macro_node (pfile, false);
+      const cpp_token *token = lex_macro_node (pfile, false);
 
-      if (node)
+      if (token)
 	{
+	  node = token->val.node;
+
 	  skip = node->type == NT_MACRO;
 	  _cpp_mark_macro_used (node);
 	  if (!(node->flags & NODE_USED))
@@ -1889,11 +1973,14 @@
 /* Read the tokens of the answer into the macro pool, in a directive
    of type TYPE.  Only commit the memory if we intend it as permanent
    storage, i.e. the #assert case.  Returns 0 on success, and sets
-   ANSWERP to point to the answer.  */
+   ANSWERP to point to the answer.  ERROR_LOC is when reporting errors
+   where the location of the tokens in the answer itself are not
+   useful.  */
 static int
-parse_answer (cpp_reader *pfile, struct answer **answerp, int type)
+parse_answer (cpp_reader *pfile, source_location error_loc,
+	      struct answer **answerp, int type)
 {
-  const cpp_token *paren;
+  const cpp_token *paren, *previous_token;
   struct answer *answer;
   unsigned int acount;
 
@@ -1916,10 +2003,12 @@
       if (type == T_UNASSERT && paren->type == CPP_EOF)
 	return 0;
 
-      cpp_error (pfile, CPP_DL_ERROR, "missing '(' after predicate");
+      cpp_error_with_line (pfile, CPP_DL_ERROR, error_loc, 0,
+			   "missing '(' after predicate");
       return 1;
     }
 
+  previous_token = paren;
   for (acount = 0;; acount++)
     {
       size_t room_needed;
@@ -1931,7 +2020,11 @@
 
       if (token->type == CPP_EOF)
 	{
-	  cpp_error (pfile, CPP_DL_ERROR, "missing ')' to complete answer");
+	  /* If we had the location of the end of the previous token,
+	     we could use that here.  */
+	  cpp_error_with_line (pfile, CPP_DL_ERROR,
+			       previous_token->src_loc, 0,
+			       "missing ')' to complete answer");
 	  return 1;
 	}
 
@@ -1947,6 +2040,7 @@
       /* Drop whitespace at start, for answer equivalence purposes.  */
       if (acount == 0)
 	dest->flags &= ~PREV_WHITE;
+      previous_token = token;
     }
 
   if (acount == 0)
@@ -1965,9 +2059,14 @@
 
 /* Parses an assertion directive of type TYPE, returning a pointer to
    the hash node of the predicate, or 0 on error.  If an answer was
-   supplied, it is placed in ANSWERP, otherwise it is set to 0.  */
+   supplied, it is placed in ANSWERP, otherwise it is set to 0.
+   ERROR_LOC is used when reporting syntax errors in the assertion,
+   when the tokens of the assertion itself are not useful for this
+   purpose.  It should point to an appropriate location at the start
+   of the assertion.  */
 static cpp_hashnode *
-parse_assertion (cpp_reader *pfile, struct answer **answerp, int type)
+parse_assertion (cpp_reader *pfile, source_location error_loc,
+		 struct answer **answerp, int type)
 {
   cpp_hashnode *result = 0;
   const cpp_token *predicate;
@@ -1978,10 +2077,12 @@
   *answerp = 0;
   predicate = cpp_get_token (pfile);
   if (predicate->type == CPP_EOF)
-    cpp_error (pfile, CPP_DL_ERROR, "assertion without predicate");
+    cpp_error_with_line (pfile, CPP_DL_ERROR, error_loc, 0,
+			 "assertion without predicate");
   else if (predicate->type != CPP_NAME)
-    cpp_error (pfile, CPP_DL_ERROR, "predicate must be an identifier");
-  else if (parse_answer (pfile, answerp, type) == 0)
+    cpp_error_with_line (pfile, CPP_DL_ERROR, predicate->src_loc, 0,
+			 "predicate must be an identifier");
+  else if (parse_answer (pfile, predicate->src_loc, answerp, type) == 0)
     {
       unsigned int len = NODE_LEN (predicate->val.node);
       unsigned char *sym = (unsigned char *) alloca (len + 1);
@@ -2024,14 +2125,17 @@
 
 /* Test an assertion within a preprocessor conditional.  Returns
    nonzero on failure, zero on success.  On success, the result of
-   the test is written into VALUE, otherwise the value 0.  */
+   the test is written into VALUE, otherwise the value 0.  ERROR_LOC
+   is the location of the '#' token; it is used for error reporting in
+   some situations.  */
 int
-_cpp_test_assertion (cpp_reader *pfile, unsigned int *value)
+_cpp_test_assertion (cpp_reader *pfile, source_location error_loc,
+		     unsigned int *value)
 {
   struct answer *answer;
   cpp_hashnode *node;
 
-  node = parse_assertion (pfile, &answer, T_IF);
+  node = parse_assertion (pfile, error_loc, &answer, T_IF);
 
   /* For recovery, an erroneous assertion expression is handled as a
      failing assertion.  */
@@ -2054,7 +2158,7 @@
   struct answer *new_answer;
   cpp_hashnode *node;
 
-  node = parse_assertion (pfile, &new_answer, T_ASSERT);
+  node = parse_assertion (pfile, pfile->directive_line, &new_answer, T_ASSERT);
   if (node)
     {
       size_t answer_size;
@@ -2099,7 +2203,7 @@
   cpp_hashnode *node;
   struct answer *answer;
 
-  node = parse_assertion (pfile, &answer, T_UNASSERT);
+  node = parse_assertion (pfile, pfile->directive_line, &answer, T_UNASSERT);
   /* It isn't an error to #unassert something that isn't asserted.  */
   if (node && node->type == NT_ASSERTION)
     {
@@ -2201,29 +2305,29 @@
 }
 
 /* Like lex_macro_node, but read the input from STR.  */
-static cpp_hashnode *
+static const cpp_token *
 lex_macro_node_from_str (cpp_reader *pfile, const char *str)
 {
   size_t len = strlen (str);
   uchar *buf = (uchar *) alloca (len + 1);
-  cpp_hashnode *node;
+  const cpp_token *token;
 
   memcpy (buf, str, len);
   buf[len] = '\n';
   cpp_push_buffer (pfile, buf, len, true);
-  node = lex_macro_node (pfile, true);
+  token = lex_macro_node (pfile, true);
   _cpp_pop_buffer (pfile);
 
-  return node;
+  return token;
 }
 
 /* If STR is a defined macro, return its definition node, else return NULL.  */
 cpp_macro *
 cpp_push_definition (cpp_reader *pfile, const char *str)
 {
-  cpp_hashnode *node = lex_macro_node_from_str (pfile, str);
-  if (node && node->type == NT_MACRO)
-    return node->value.macro;
+  const cpp_token *token = lex_macro_node_from_str (pfile, str);
+  if (token && token->val.node->type == NT_MACRO)
+    return token->val.node->value.macro;
   else
     return NULL;
 }
@@ -2233,9 +2337,11 @@
 void
 cpp_pop_definition (cpp_reader *pfile, const char *str, cpp_macro *dfn)
 {
-  cpp_hashnode *node = lex_macro_node_from_str (pfile, str);
-  if (node == NULL)
+  cpp_hashnode *node;
+  const cpp_token *token = lex_macro_node_from_str (pfile, str);
+  if (token == NULL)
     return;
+  node = token->val.node;
 
   if (pfile->cb.before_define)
     pfile->cb.before_define (pfile);
Index: libcpp/ChangeLog
===================================================================
--- libcpp/ChangeLog	(revision 140858)
+++ libcpp/ChangeLog	(working copy)
@@ -1,3 +1,21 @@
+2008-08-28  Tom Tromey  <tromey@redhat.com>
+
+	* internal.h (_cpp_test_assertion): Update.
+	* expr.c (eval_token): Update.
+	* directives.c (start_directive): Add loc argument.
+	(_cpp_handle_directive): Update.
+	(run_directive): Update.
+	(destringize_and_run): Add start_column and directive_location
+	arguments.  Insert spaces into temporary buffer.
+	(_cpp_do__Pragma): Save and restore current location.
+	(parse_answer): Add error_loc argument.  Use cpp_error_with_line.
+	(parse_assertion): Likewise.
+	(_cpp_test_assertion): Add error_loc argument.
+	(do_assert): Update.
+	(do_unassert): Update.
+	* macro.c (create_iso_definition): Emit '##' error at correct
+	location.
+
 2008-09-18  Simon Baldwin  <simonb@google.com>
 
 	* include/cpplib.h (struct cpp_options): Add new boolean flag
Index: libcpp/pch.c
===================================================================
--- libcpp/pch.c	(revision 140858)
+++ libcpp/pch.c	(working copy)
@@ -1,5 +1,5 @@
 /* Part of CPP library.  (Precompiled header reading/writing.)
-   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2008
    Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify it
@@ -702,7 +702,9 @@
 	      != NULL)
 	    {
 	      _cpp_clean_line (r);
-	      if (!_cpp_create_definition (r, h))
+	      /* It is strange, but we do not seem to save macro
+		 locations.  */
+	      if (!_cpp_create_definition (r, h, 0))
 		abort ();
 	      _cpp_pop_buffer (r);
 	    }
Index: libcpp/expr.c
===================================================================
--- libcpp/expr.c	(revision 140858)
+++ libcpp/expr.c	(working copy)
@@ -43,8 +43,10 @@
 static cpp_num num_trim (cpp_num, size_t);
 static cpp_num num_part_mul (cpp_num_part, cpp_num_part);
 
-static cpp_num num_unary_op (cpp_reader *, cpp_num, enum cpp_ttype);
-static cpp_num num_binary_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype);
+static cpp_num num_unary_op (cpp_reader *, cpp_num, enum cpp_ttype,
+			     source_location);
+static cpp_num num_binary_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype,
+			      source_location);
 static cpp_num num_negate (cpp_num, size_t);
 static cpp_num num_bitwise_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype);
 static cpp_num num_inequality_op (cpp_reader *, cpp_num, cpp_num,
@@ -52,7 +54,8 @@
 static cpp_num num_equality_op (cpp_reader *, cpp_num, cpp_num,
 				enum cpp_ttype);
 static cpp_num num_mul (cpp_reader *, cpp_num, cpp_num);
-static cpp_num num_div_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype);
+static cpp_num num_div_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype,
+			   source_location);
 static cpp_num num_lshift (cpp_num, size_t, size_t);
 static cpp_num num_rshift (cpp_num, size_t, size_t);
 
@@ -70,11 +73,34 @@
 
 /* With -O2, gcc appears to produce nice code, moving the error
    message load and subsequent jump completely out of the main path.  */
-#define SYNTAX_ERROR(msgid) \
-  do { cpp_error (pfile, CPP_DL_ERROR, msgid); goto syntax_error; } while(0)
-#define SYNTAX_ERROR2(msgid, arg) \
-  do { cpp_error (pfile, CPP_DL_ERROR, msgid, arg); goto syntax_error; } \
-  while(0)
+#define SYNTAX_ERROR(loc, msgid)				\
+  do								\
+    {								\
+      cpp_error_with_line (pfile, CPP_DL_ERROR, loc, 0, msgid);	\
+      goto syntax_error;					\
+    }								\
+  while (0)
+#define SYNTAX_ERROR2(loc, msgid, arg)					\
+  do									\
+    {									\
+      cpp_error_with_line (pfile, CPP_DL_ERROR, loc, 0, msgid, arg);	\
+      goto syntax_error;						\
+    }									\
+  while (0)
+#define SYNTAX_ERROR_NOLOC(msgid)		\
+  do						\
+    {						\
+      cpp_error (pfile, CPP_DL_ERROR, msgid);	\
+      goto syntax_error;			\
+    }						\
+  while (0)
+#define SYNTAX_ERROR2_NOLOC(msgid, arg)			\
+  do							\
+    {							\
+      cpp_error (pfile, CPP_DL_ERROR, msgid, arg);	\
+      goto syntax_error;				\
+    }							\
+  while (0)
 
 /* Subroutine of cpp_classify_number.  S points to a float suffix of
    length LEN, possibly zero.  Returns 0 for an invalid suffix, or a
@@ -258,7 +284,7 @@
 	  if (float_flag == NOT_FLOAT)
 	    float_flag = AFTER_POINT;
 	  else
-	    SYNTAX_ERROR ("too many decimal points in number");
+	    SYNTAX_ERROR_NOLOC ("too many decimal points in number");
 	}
       else if ((radix <= 10 && (c == 'e' || c == 'E'))
 	       || (radix == 16 && (c == 'p' || c == 'P')))
@@ -300,19 +326,17 @@
   if (max_digit >= radix)
     {
       if (radix == 2)
-	SYNTAX_ERROR2 ("invalid digit \"%c\" in binary constant", '0' + max_digit);
+	SYNTAX_ERROR2_NOLOC ("invalid digit \"%c\" in binary constant",
+			     '0' + max_digit);
       else
-	SYNTAX_ERROR2 ("invalid digit \"%c\" in octal constant", '0' + max_digit);
+	SYNTAX_ERROR2_NOLOC ("invalid digit \"%c\" in octal constant",
+			     '0' + max_digit);
     }
 
   if (float_flag != NOT_FLOAT)
     {
       if (radix == 2)
-	{
-	  cpp_error (pfile, CPP_DL_ERROR,
-		     "invalid prefix \"0b\" for floating constant");
-	  return CPP_N_INVALID;
-	}
+	SYNTAX_ERROR_NOLOC ("invalid prefix \"0b\" for floating constant");
 
       if (radix == 16 && CPP_PEDANTIC (pfile) && !CPP_OPTION (pfile, c99))
 	cpp_error (pfile, CPP_DL_PEDWARN,
@@ -325,14 +349,14 @@
 
 	  /* Exponent is decimal, even if string is a hex float.  */
 	  if (!ISDIGIT (*str))
-	    SYNTAX_ERROR ("exponent has no digits");
+	    SYNTAX_ERROR_NOLOC ("exponent has no digits");
 
 	  do
 	    str++;
 	  while (ISDIGIT (*str));
 	}
       else if (radix == 16)
-	SYNTAX_ERROR ("hexadecimal floating constants require an exponent");
+	SYNTAX_ERROR_NOLOC ("hexadecimal floating constants require an exponent");
 
       result = interpret_float_suffix (str, limit - str);
       if (result == 0)
@@ -355,8 +379,8 @@
       if ((result & CPP_N_DFLOAT) && radix != 10)
         {
           cpp_error (pfile, CPP_DL_ERROR,
-                     "invalid suffix \"%.*s\" with hexadecimal floating constant",
-                     (int) (limit - str), str);
+		     "invalid suffix \"%.*s\" with hexadecimal floating constant",
+		     (int) (limit - str), str);
           return CPP_N_INVALID;
         }
 
@@ -757,7 +781,7 @@
 	    cpp_error (pfile, CPP_DL_WARNING,
 		       "assertions are a deprecated extension");
 	}
-      _cpp_test_assertion (pfile, &temp);
+      _cpp_test_assertion (pfile, token->src_loc, &temp);
       result.high = 0;
       result.low = temp;
       break;
@@ -887,7 +911,8 @@
 	case CPP_NAME:
 	case CPP_HASH:
 	  if (!want_value)
-	    SYNTAX_ERROR2 ("missing binary operator before token \"%s\"",
+	    SYNTAX_ERROR2 (op.token->src_loc,
+			   "missing binary operator before token \"%s\"",
 			   cpp_token_as_text (pfile, op.token));
 	  want_value = false;
 	  top->value = eval_token (pfile, op.token);
@@ -907,7 +932,8 @@
 
 	default:
 	  if ((int) op.op <= (int) CPP_EQ || (int) op.op >= (int) CPP_PLUS_EQ)
-	    SYNTAX_ERROR2 ("token \"%s\" is not valid in preprocessor expressions",
+	    SYNTAX_ERROR2 (op.token->src_loc,
+			   "token \"%s\" is not valid in preprocessor expressions",
 			   cpp_token_as_text (pfile, op.token));
 	  break;
 	}
@@ -916,7 +942,8 @@
       if (optab[op.op].flags & NO_L_OPERAND)
 	{
 	  if (!want_value)
-	    SYNTAX_ERROR2 ("missing binary operator before token \"%s\"",
+	    SYNTAX_ERROR2 (op.token->src_loc,
+			   "missing binary operator before token \"%s\"",
 			   cpp_token_as_text (pfile, op.token));
 	}
       else if (want_value)
@@ -924,18 +951,22 @@
 	  /* We want a number (or expression) and haven't got one.
 	     Try to emit a specific diagnostic.  */
 	  if (op.op == CPP_CLOSE_PAREN && top->op == CPP_OPEN_PAREN)
-	    SYNTAX_ERROR ("missing expression between '(' and ')'");
+	    SYNTAX_ERROR (op.token->src_loc,
+			  "missing expression between '(' and ')'");
 
 	  if (op.op == CPP_EOF && top->op == CPP_EOF)
- 	    SYNTAX_ERROR2 ("%s with no expression", is_if ? "#if" : "#elif");
+ 	    SYNTAX_ERROR2 (pfile->directive_line, "%s with no expression",
+			   is_if ? "#if" : "#elif");
 
  	  if (top->op != CPP_EOF && top->op != CPP_OPEN_PAREN)
- 	    SYNTAX_ERROR2 ("operator '%s' has no right operand",
+ 	    SYNTAX_ERROR2 (top->token->src_loc,
+			   "operator '%s' has no right operand",
  			   cpp_token_as_text (pfile, top->token));
 	  else if (op.op == CPP_CLOSE_PAREN || op.op == CPP_EOF)
 	    /* Complain about missing paren during reduction.  */;
 	  else
-	    SYNTAX_ERROR2 ("operator '%s' has no left operand",
+	    SYNTAX_ERROR2 (op.token->src_loc,
+			   "operator '%s' has no left operand",
 			   cpp_token_as_text (pfile, op.token));
 	}
 
@@ -961,7 +992,7 @@
 	  break;
 	case CPP_COLON:
 	  if (top->op != CPP_QUERY)
-	    SYNTAX_ERROR (" ':' without preceding '?'");
+	    SYNTAX_ERROR (op.token->src_loc, " ':' without preceding '?'");
 	  if (!num_zerop (top[-1].value)) /* Was '?' condition true?  */
 	    pfile->state.skip_eval++;
 	  else
@@ -988,8 +1019,9 @@
 
   if (top != pfile->op_stack)
     {
-      cpp_error (pfile, CPP_DL_ICE, "unbalanced stack in %s",
-		 is_if ? "#if" : "#elif");
+      cpp_error_with_line (pfile, CPP_DL_ICE, pfile->directive_line, 0,
+			   "unbalanced stack in %s",
+			   is_if ? "#if" : "#elif");
     syntax_error:
       return false;  /* Return false on syntax error.  */
     }
@@ -1008,7 +1040,8 @@
   if (top->op <= CPP_EQ || top->op > CPP_LAST_CPP_OP + 2)
     {
     bad_op:
-      cpp_error (pfile, CPP_DL_ICE, "impossible operator '%u'", top->op);
+      cpp_error_with_line (pfile, CPP_DL_ICE, top->token->src_loc, 0,
+			   "impossible operator '%u'", top->op);
       return 0;
     }
 
@@ -1030,7 +1063,8 @@
 	case CPP_UMINUS:
 	case CPP_NOT:
 	case CPP_COMPL:
-	  top[-1].value = num_unary_op (pfile, top->value, top->op);
+	  top[-1].value = num_unary_op (pfile, top->value, top->op,
+					top->token->src_loc);
 	  break;
 
 	case CPP_PLUS:
@@ -1039,7 +1073,8 @@
 	case CPP_LSHIFT:
 	case CPP_COMMA:
 	  top[-1].value = num_binary_op (pfile, top[-1].value,
-					 top->value, top->op);
+					 top->value, top->op,
+					 top->token->src_loc);
 	  break;
 
 	case CPP_GREATER:
@@ -1070,7 +1105,8 @@
 	case CPP_DIV:
 	case CPP_MOD:
 	  top[-1].value = num_div_op (pfile, top[-1].value,
-				      top->value, top->op);
+				      top->value, top->op,
+				      top->token->src_loc);
 	  break;
 
 	case CPP_OR_OR:
@@ -1098,7 +1134,9 @@
 	case CPP_OPEN_PAREN:
 	  if (op != CPP_CLOSE_PAREN)
 	    {
-	      cpp_error (pfile, CPP_DL_ERROR, "missing ')' in expression");
+	      cpp_error_with_line (pfile, CPP_DL_ERROR,
+				   top->token->src_loc, 0,
+				   "missing ')' in expression");
 	      return 0;
 	    }
 	  top--;
@@ -1122,7 +1160,8 @@
 	  /* COMMA and COLON should not reduce a QUERY operator.  */
 	  if (op == CPP_COMMA || op == CPP_COLON)
 	    return top;
-	  cpp_error (pfile, CPP_DL_ERROR, "'?' without following ':'");
+	  cpp_error_with_line (pfile, CPP_DL_ERROR, top->token->src_loc, 0,
+			       "'?' without following ':'");
 	  return 0;
 
 	default:
@@ -1131,8 +1170,8 @@
 
       top--;
       if (top->value.overflow && !pfile->state.skip_eval)
-	cpp_error (pfile, CPP_DL_PEDWARN,
-		   "integer overflow in preprocessor expression");
+	cpp_error_with_line (pfile, CPP_DL_PEDWARN, top[1].token->src_loc, 0,
+			     "integer overflow in preprocessor expression");
     }
 
   if (op == CPP_CLOSE_PAREN)
@@ -1168,14 +1207,14 @@
   if (op->value.unsignedp)
     {
       if (!num_positive (op[-1].value, CPP_OPTION (pfile, precision)))
-	cpp_error (pfile, CPP_DL_WARNING,
-		   "the left operand of \"%s\" changes sign when promoted",
-		   cpp_token_as_text (pfile, op->token));
+	cpp_error_with_line (pfile, CPP_DL_WARNING, op->token->src_loc, 0,
+			     "the left operand of \"%s\" changes sign when promoted",
+			     cpp_token_as_text (pfile, op->token));
     }
   else if (!num_positive (op->value, CPP_OPTION (pfile, precision)))
-    cpp_error (pfile, CPP_DL_WARNING,
-	       "the right operand of \"%s\" changes sign when promoted",
-	       cpp_token_as_text (pfile, op->token));
+    cpp_error_with_line (pfile, CPP_DL_WARNING, op->token->src_loc, 0,
+			 "the right operand of \"%s\" changes sign when promoted",
+			 cpp_token_as_text (pfile, op->token));
 }
 
 /* Clears the unused high order bits of the number pointed to by PNUM.  */
@@ -1426,14 +1465,15 @@
 
 /* The four unary operators: +, -, ! and ~.  */
 static cpp_num
-num_unary_op (cpp_reader *pfile, cpp_num num, enum cpp_ttype op)
+num_unary_op (cpp_reader *pfile, cpp_num num, enum cpp_ttype op,
+	      source_location loc)
 {
   switch (op)
     {
     case CPP_UPLUS:
       if (CPP_WTRADITIONAL (pfile) && !pfile->state.skip_eval)
-	cpp_error (pfile, CPP_DL_WARNING,
-		   "traditional C rejects the unary plus operator");
+	cpp_error_with_line (pfile, CPP_DL_WARNING, loc, 0,
+			     "traditional C rejects the unary plus operator");
       num.overflow = false;
       break;
 
@@ -1461,7 +1501,8 @@
 
 /* The various binary operators.  */
 static cpp_num
-num_binary_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
+num_binary_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op,
+	       source_location loc)
 {
   cpp_num result;
   size_t precision = CPP_OPTION (pfile, precision);
@@ -1515,7 +1556,7 @@
     default: /* case CPP_COMMA: */
       if (CPP_PEDANTIC (pfile) && (!CPP_OPTION (pfile, c99)
 				   || !pfile->state.skip_eval))
-	cpp_error (pfile, CPP_DL_PEDWARN,
+	cpp_error_with_line (pfile, CPP_DL_PEDWARN, loc, 0,
 		   "comma operator in operand of #if");
       lhs = rhs;
       break;
@@ -1608,7 +1649,8 @@
 /* Divide two preprocessing numbers, returning the answer or the
    remainder depending upon OP.  */
 static cpp_num
-num_div_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
+num_div_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op,
+	    source_location loc)
 {
   cpp_num result, sub;
   cpp_num_part mask;
@@ -1648,7 +1690,8 @@
   else
     {
       if (!pfile->state.skip_eval)
-	cpp_error (pfile, CPP_DL_ERROR, "division by zero in #if");
+	cpp_error_with_line (pfile, CPP_DL_ERROR, loc, 0,
+			     "division by zero in #if");
       return lhs;
     }
 
@@ -1667,7 +1710,7 @@
     {
       if (num_greater_eq (lhs, sub, precision))
 	{
-	  lhs = num_binary_op (pfile, lhs, sub, CPP_MINUS);
+	  lhs = num_binary_op (pfile, lhs, sub, CPP_MINUS, loc);
 	  if (i >= PART_PRECISION)
 	    result.high |= (cpp_num_part) 1 << (i - PART_PRECISION);
 	  else
Index: libcpp/internal.h
===================================================================
--- libcpp/internal.h	(revision 140858)
+++ libcpp/internal.h	(working copy)
@@ -520,7 +520,8 @@
 
 /* In macro.c */
 extern void _cpp_free_definition (cpp_hashnode *);
-extern bool _cpp_create_definition (cpp_reader *, cpp_hashnode *);
+extern bool _cpp_create_definition (cpp_reader *, cpp_hashnode *,
+				    source_location);
 extern void _cpp_pop_context (cpp_reader *);
 extern void _cpp_push_text_context (cpp_reader *, cpp_hashnode *,
 				    const unsigned char *, size_t);
@@ -576,7 +577,7 @@
 extern void _cpp_maybe_push_include_file (cpp_reader *);
 
 /* In directives.c */
-extern int _cpp_test_assertion (cpp_reader *, unsigned int *);
+extern int _cpp_test_assertion (cpp_reader *, source_location, unsigned int *);
 extern int _cpp_handle_directive (cpp_reader *, int);
 extern void _cpp_define_builtin (cpp_reader *, const char *);
 extern char ** _cpp_save_pragma_names (cpp_reader *);
Index: libcpp/lex.c
===================================================================
--- libcpp/lex.c	(revision 140858)
+++ libcpp/lex.c	(working copy)
@@ -663,8 +663,11 @@
 	       "null character(s) preserved in literal");
 
   if (type == CPP_OTHER && CPP_OPTION (pfile, lang) != CLK_ASM)
-    cpp_error (pfile, CPP_DL_PEDWARN, "missing terminating %c character",
-	       (int) terminator);
+    /* It seems nicer to use the location of the starting quote for
+       this error.  */
+    cpp_error_with_line (pfile, CPP_DL_PEDWARN, token->src_loc, 0,
+			 "missing terminating %c character",
+			 (int) terminator);
 
   pfile->buffer->cur = cur;
   create_literal (pfile, token, base, cur - base, type);

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: macro locations --]
[-- Type: text/x-patch, Size: 45352 bytes --]

Index: gcc/c-lex.c
===================================================================
--- gcc/c-lex.c	(revision 148688)
+++ gcc/c-lex.c	(working copy)
@@ -1,6 +1,6 @@
 /* Mainly the interface between cpplib and the C front ends.
    Copyright (C) 1987, 1988, 1989, 1992, 1994, 1995, 1996, 1997
-   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
+   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -211,7 +211,7 @@
 	    line = SOURCE_LINE (new_map - 1, included_at);
 
 	  input_location = new_map->start_location;
-	  (*debug_hooks->start_source_file) (line, new_map->to_file);
+	  (*debug_hooks->start_source_file) (line, LINEMAP_FILE (new_map));
 #ifndef NO_IMPLICIT_EXTERN_C
 	  if (c_header_level)
 	    ++c_header_level;
@@ -235,10 +235,10 @@
 #endif
       input_location = new_map->start_location;
 
-      (*debug_hooks->end_source_file) (new_map->to_line);
+      (*debug_hooks->end_source_file) (LINEMAP_LINE (new_map));
     }
 
-  update_header_times (new_map->to_file);
+  update_header_times (LINEMAP_FILE (new_map));
   input_location = new_map->start_location;
 }
 
@@ -303,7 +303,8 @@
 
   timevar_push (TV_CPP);
  retry:
-  tok = cpp_get_token_with_location (parse_in, loc);
+  tok = cpp_get_token (parse_in);
+  *loc = tok->src_loc;
   type = tok->type;
 
  retry_after_at:
@@ -351,10 +352,9 @@
       if (c_dialect_objc ())
 	{
 	  location_t atloc = *loc;
-	  location_t newloc;
 
 	retry_at:
-	  tok = cpp_get_token_with_location (parse_in, &newloc);
+	  tok = cpp_get_token (parse_in);
 	  type = tok->type;
 	  switch (type)
 	    {
@@ -380,7 +380,7 @@
 	    default:
 	      /* ... or not.  */
 	      error ("%Hstray %<@%> in program", &atloc);
-	      *loc = newloc;
+	      *loc = tok->src_loc;
 	      goto retry_after_at;
 	    }
 	  break;
Index: gcc/tree.c
===================================================================
--- gcc/tree.c	(revision 148688)
+++ gcc/tree.c	(working copy)
@@ -3599,28 +3599,6 @@
   return block;
 }
 
-expanded_location
-expand_location (source_location loc)
-{
-  expanded_location xloc;
-  if (loc == 0)
-    {
-      xloc.file = NULL;
-      xloc.line = 0;
-      xloc.column = 0;
-      xloc.sysp = 0;
-    }
-  else
-    {
-      const struct line_map *map = linemap_lookup (line_table, loc);
-      xloc.file = map->to_file;
-      xloc.line = SOURCE_LINE (map, loc);
-      xloc.column = SOURCE_COLUMN (map, loc);
-      xloc.sysp = map->sysp != 0;
-    };
-  return xloc;
-}
-
 \f
 /* Source location accessor functions.  */
 
Index: gcc/diagnostic.c
===================================================================
--- gcc/diagnostic.c	(revision 148688)
+++ gcc/diagnostic.c	(working copy)
@@ -41,6 +41,7 @@
 #include "langhooks-def.h"
 #include "opts.h"
 #include "plugin.h"
+#include "cpp-id-data.h"
 
 #define pedantic_warning_kind() (flag_pedantic_errors ? DK_ERROR : DK_WARNING)
 #define permissive_error_kind() (flag_permissive ? DK_WARNING : DK_ERROR)
@@ -219,12 +220,12 @@
 diagnostic_report_current_function (diagnostic_context *context,
 				    diagnostic_info *diagnostic)
 {
-  diagnostic_report_current_module (context);
+  diagnostic_report_current_module (context, diagnostic->location);
   lang_hooks.print_error_function (context, input_filename, diagnostic);
 }
 
 void
-diagnostic_report_current_module (diagnostic_context *context)
+diagnostic_report_current_module (diagnostic_context *context, location_t where)
 {
   const struct line_map *map;
 
@@ -234,31 +235,50 @@
       pp_needs_newline (context->printer) = false;
     }
 
-  if (input_location <= BUILTINS_LOCATION)
+  if (where <= BUILTINS_LOCATION)
     return;
 
-  map = linemap_lookup (line_table, input_location);
+  map = linemap_lookup (line_table, where);
   if (map && diagnostic_last_module_changed (context, map))
     {
+      struct line_map *macro_map;
+
       diagnostic_set_last_module (context, map);
+      for (macro_map = map; macro_map->reason == LC_ENTER_MACRO; )
+ 	{
+ 	  expanded_location loc;
+ 	  source_location l2 = where - macro_map->start_location;
+ 	  where = macro_map->d.macro.macro_locations[2 * l2 + 1];
+ 	  loc = expand_location (where);
+ 	  pp_verbatim (context->printer,
+ 		       "While expanding macro %s at %s:%d:%d",
+ 		       LINEMAP_MACRO_NAME (macro_map),
+		       loc.file, loc.line, loc.column);
+	  pp_newline (context->printer);
+ 	  macro_map = linemap_lookup (line_table, where);
+ 	}
+
+      while (map->reason == LC_ENTER_MACRO)
+ 	map = linemap_lookup (line_table, map->d.macro.expansion);
+
       if (! MAIN_FILE_P (map))
 	{
 	  map = INCLUDED_FROM (line_table, map);
 	  if (flag_show_column)
 	    pp_verbatim (context->printer,
 			 "In file included from %s:%d:%d",
-			 map->to_file,
+			 LINEMAP_FILE (map),
 			 LAST_SOURCE_LINE (map), LAST_SOURCE_COLUMN (map));
 	  else
 	    pp_verbatim (context->printer,
 			 "In file included from %s:%d",
-			 map->to_file, LAST_SOURCE_LINE (map));
+			 LINEMAP_FILE (map), LAST_SOURCE_LINE (map));
 	  while (! MAIN_FILE_P (map))
 	    {
 	      map = INCLUDED_FROM (line_table, map);
 	      pp_verbatim (context->printer,
 			   ",\n                 from %s:%d",
-			   map->to_file, LAST_SOURCE_LINE (map));
+			   LINEMAP_FILE (map), LAST_SOURCE_LINE (map));
 	    }
 	  pp_verbatim (context->printer, ":");
 	  pp_newline (context->printer);
Index: gcc/diagnostic.h
===================================================================
--- gcc/diagnostic.h	(revision 148688)
+++ gcc/diagnostic.h	(working copy)
@@ -192,7 +192,8 @@
 
 /* Diagnostic related functions.  */
 extern void diagnostic_initialize (diagnostic_context *);
-extern void diagnostic_report_current_module (diagnostic_context *);
+extern void diagnostic_report_current_module (diagnostic_context *,
+					      location_t);
 extern void diagnostic_report_current_function (diagnostic_context *,
 						diagnostic_info *);
 
Index: gcc/input.h
===================================================================
--- gcc/input.h	(revision 148688)
+++ gcc/input.h	(working copy)
@@ -1,6 +1,6 @@
 /* Declarations for variables relating to reading the source file.
    Used by parsers, lexical analyzers, and error message routines.
-   Copyright (C) 1993, 1997, 1998, 2000, 2003, 2004, 2007, 2008
+   Copyright (C) 1993, 1997, 1998, 2000, 2003, 2004, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -32,22 +32,6 @@
 /* The location for declarations in "<built-in>" */
 #define BUILTINS_LOCATION ((source_location) 2)
 
-typedef struct GTY (())
-{
-  /* The name of the source file involved.  */
-  const char *file;
-
-  /* The line-location in the source file.  */
-  int line;
-
-  int column;
-
-  /* In a system header?. */
-  bool sysp;
-} expanded_location;
-
-extern expanded_location expand_location (source_location);
-
 /* Historically GCC used location_t, while cpp used source_location.
    This could be removed but it hardly seems worth the effort.  */
 typedef source_location location_t;
@@ -65,4 +49,6 @@
 #define in_system_header_at(LOC) ((expand_location (LOC)).sysp != 0)
 #define in_system_header (in_system_header_at (input_location))
 
+#define expand_location(LOC) linemap_expand_location (line_table, LOC)
+
 #endif
Index: gcc/cp/error.c
===================================================================
--- gcc/cp/error.c	(revision 148688)
+++ gcc/cp/error.c	(working copy)
@@ -2518,7 +2518,7 @@
 cp_diagnostic_starter (diagnostic_context *context,
 		       diagnostic_info *diagnostic)
 {
-  diagnostic_report_current_module (context);
+  diagnostic_report_current_module (context, diagnostic->location);
   cp_print_error_function (context, diagnostic);
   maybe_print_instantiation_context (context);
   pp_base_set_prefix (context->printer, diagnostic_build_prefix (diagnostic));
Index: gcc/fortran/cpp.c
===================================================================
--- gcc/fortran/cpp.c	(revision 148688)
+++ gcc/fortran/cpp.c	(working copy)
@@ -779,26 +779,30 @@
   if (!gfc_cpp_option.no_line_commands)
     {
       const struct line_map *map = linemap_lookup (line_table, src_loc);
+      struct expanded_location loc;
 
-      size_t to_file_len = strlen (map->to_file);
-      unsigned char *to_file_quoted =
-         (unsigned char *) alloca (to_file_len * 4 + 1);
+      size_t to_file_len;
+      unsigned char *to_file_quoted;
       unsigned char *p;
 
-      print.src_line = SOURCE_LINE (map, src_loc);
+      loc = expand_location (src_loc);
+      to_file_len = strlen (loc.file);
+      to_file_quoted = (unsigned char *) alloca (to_file_len * 4 + 1);
 
+      print.src_line = loc.line;
+
       /* cpp_quote_string does not nul-terminate, so we have to do it
 	 ourselves.  */
       p = cpp_quote_string (to_file_quoted,
-			    (const unsigned char *) map->to_file, to_file_len);
+			    (const unsigned char *) loc.file, to_file_len);
       *p = '\0';
       fprintf (print.outf, "# %u \"%s\"%s",
 	       print.src_line == 0 ? 1 : print.src_line,
 	       to_file_quoted, special_flags);
 
-      if (map->sysp == 2)
+      if (loc.sysp == 2)
 	fputs (" 3 4", print.outf);
-      else if (map->sysp == 1)
+      else if (loc.sysp == 1)
 	fputs (" 3", print.outf);
 
       putc ('\n', print.outf);
Index: gcc/c-ppoutput.c
===================================================================
--- gcc/c-ppoutput.c	(revision 148688)
+++ gcc/c-ppoutput.c	(working copy)
@@ -306,7 +306,7 @@
     {
       const struct line_map *map = linemap_lookup (line_table, src_loc);
 
-      size_t to_file_len = strlen (map->to_file);
+      size_t to_file_len = strlen (LINEMAP_FILE (map));
       unsigned char *to_file_quoted =
          (unsigned char *) alloca (to_file_len * 4 + 1);
       unsigned char *p;
@@ -316,15 +316,16 @@
       /* cpp_quote_string does not nul-terminate, so we have to do it
 	 ourselves.  */
       p = cpp_quote_string (to_file_quoted,
-			    (const unsigned char *) map->to_file, to_file_len);
+			    (const unsigned char *) LINEMAP_FILE (map),
+			    to_file_len);
       *p = '\0';
       fprintf (print.outf, "# %u \"%s\"%s",
 	       print.src_line == 0 ? 1 : print.src_line,
 	       to_file_quoted, special_flags);
 
-      if (map->sysp == 2)
+      if (LINEMAP_SYSP (map) == 2)
 	fputs (" 3 4", print.outf);
-      else if (map->sysp == 1)
+      else if (LINEMAP_SYSP (map) == 1)
 	fputs (" 3", print.outf);
 
       putc ('\n', print.outf);
@@ -377,6 +378,10 @@
 static void
 cb_define (cpp_reader *pfile, source_location line, cpp_hashnode *node)
 {
+  const struct line_map *map;
+
+  if (line <= BUILTINS_LOCATION)
+    return;
   maybe_print_line (line);
   fputs ("#define ", print.outf);
 
@@ -388,7 +393,8 @@
     fputs ((const char *) NODE_NAME (node), print.outf);
 
   putc ('\n', print.outf);
-  if (linemap_lookup (line_table, line)->to_line != 0)
+  map = linemap_lookup (line_table, line);
+  if (LINEMAP_LINE (map) != 0)
     print.src_line++;
 }
 
@@ -396,6 +402,8 @@
 cb_undef (cpp_reader *pfile ATTRIBUTE_UNUSED, source_location line,
 	  cpp_hashnode *node)
 {
+  if (line <= BUILTINS_LOCATION)
+    return;
   maybe_print_line (line);
   fprintf (print.outf, "#undef %s\n", NODE_NAME (node));
   print.src_line++;
Index: libcpp/macro.c
===================================================================
--- libcpp/macro.c	(revision 148688)
+++ libcpp/macro.c	(working copy)
@@ -47,7 +47,7 @@
 static void push_ptoken_context (cpp_reader *, cpp_hashnode *, _cpp_buff *,
 				 const cpp_token **, unsigned int);
 static _cpp_buff *collect_args (cpp_reader *, const cpp_hashnode *,
-				_cpp_buff **);
+				_cpp_buff **, source_location *);
 static cpp_context *next_context (cpp_reader *);
 static const cpp_token *padding_token (cpp_reader *, const cpp_token *);
 static void expand_arg (cpp_reader *, macro_arg *);
@@ -56,9 +56,9 @@
 static void paste_all_tokens (cpp_reader *, const cpp_token *);
 static bool paste_tokens (cpp_reader *, const cpp_token **, const cpp_token *);
 static void replace_args (cpp_reader *, cpp_hashnode *, cpp_macro *,
-			  macro_arg *);
+			  macro_arg *, source_location, source_location);
 static _cpp_buff *funlike_invocation_p (cpp_reader *, cpp_hashnode *,
-					_cpp_buff **);
+					_cpp_buff **, source_location *);
 static bool create_iso_definition (cpp_reader *, cpp_macro *);
 
 /* #define directive parsing and handling.  */
@@ -177,7 +177,8 @@
 	  while (! MAIN_FILE_P (map))
 	    map = INCLUDED_FROM (pfile->line_table, map);
 
-	name = map->to_file;
+	linemap_check_ordinary (map);
+	name = map->d.ordinary.to_file;
 	len = strlen (name);
 	buf = _cpp_unaligned_alloc (pfile, len * 2 + 3);
 	result = buf;
@@ -586,7 +587,7 @@
    CPP_PRAGMA ... CPP_PRAGMA_EOL tokens into *PRAGMA_BUFF buffer.  */
 static _cpp_buff *
 collect_args (cpp_reader *pfile, const cpp_hashnode *node,
-	      _cpp_buff **pragma_buff)
+	      _cpp_buff **pragma_buff, source_location *paren_loc)
 {
   _cpp_buff *buff, *base_buff;
   cpp_macro *macro;
@@ -735,6 +736,7 @@
     }
   else
     {
+      *paren_loc = token->src_loc;
       /* A single empty argument is counted as no argument.  */
       if (argc == 1 && macro->paramc == 0 && args[0].count == 0)
 	argc = 0;
@@ -767,7 +769,7 @@
    argument is the same as in collect_args.  */
 static _cpp_buff *
 funlike_invocation_p (cpp_reader *pfile, cpp_hashnode *node,
-		      _cpp_buff **pragma_buff)
+		      _cpp_buff **pragma_buff, source_location *paren_loc)
 {
   const cpp_token *token, *padding = NULL;
 
@@ -784,7 +786,7 @@
   if (token->type == CPP_OPEN_PAREN)
     {
       pfile->state.parsing_args = 2;
-      return collect_args (pfile, node, pragma_buff);
+      return collect_args (pfile, node, pragma_buff, paren_loc);
     }
 
   /* CPP_EOF can be the end of macro arguments, or the end of the
@@ -843,6 +845,7 @@
     {
       cpp_macro *macro = node->value.macro;
       _cpp_buff *pragma_buff = NULL;
+      source_location paren_loc = result->src_loc;
 
       if (macro->fun_like)
 	{
@@ -851,7 +854,8 @@
 	  pfile->state.prevent_expansion++;
 	  pfile->keep_tokens++;
 	  pfile->state.parsing_args = 1;
-	  buff = funlike_invocation_p (pfile, node, &pragma_buff);
+	  buff = funlike_invocation_p (pfile, node, &pragma_buff,
+				       &paren_loc);
 	  pfile->state.parsing_args = 0;
 	  pfile->keep_tokens--;
 	  pfile->state.prevent_expansion--;
@@ -870,7 +874,8 @@
 	    }
 
 	  if (macro->paramc > 0)
-	    replace_args (pfile, node, macro, (macro_arg *) buff->base);
+	    replace_args (pfile, node, macro, (macro_arg *) buff->base,
+			  result->src_loc, paren_loc);
 	  _cpp_release_buff (pfile, buff);
 	}
 
@@ -887,8 +892,29 @@
       macro->used = 1;
 
       if (macro->paramc == 0)
-	_cpp_push_token_context (pfile, node, macro->exp.tokens,
-				 macro_real_token_count (macro));
+	{
+	  unsigned int i, count = macro_real_token_count (macro);
+	  _cpp_buff *buff = _cpp_get_buff (pfile,
+					   count * sizeof (cpp_token));
+	  const cpp_token *src = macro->exp.tokens;
+	  cpp_token *first = (cpp_token *) buff->base;
+	  cpp_token *dest = first;
+	  const struct line_map *map
+	    = linemap_enter_macro (pfile->line_table, macro,
+				   result->src_loc, count);
+	  for (i = 0; i < count; ++i)
+	    {
+	      *dest = *src;
+	      dest->src_loc = linemap_add_macro_token (map, i,
+						       dest->src_loc,
+						       dest->src_loc);
+	      ++dest;
+	      ++src;
+	    }
+	  linemap_leave_macro (pfile->line_table, paren_loc);
+	  /* FIXME freeing  */
+	  _cpp_push_token_context (pfile, node, first, count);
+	}
 
       if (pragma_buff)
 	{
@@ -921,14 +947,17 @@
    Expand each argument before replacing, unless it is operated upon
    by the # or ## operators.  */
 static void
-replace_args (cpp_reader *pfile, cpp_hashnode *node, cpp_macro *macro, macro_arg *args)
+replace_args (cpp_reader *pfile, cpp_hashnode *node, cpp_macro *macro,
+	      macro_arg *args, source_location macro_loc,
+	      source_location paren_loc)
 {
   unsigned int i, total;
   const cpp_token *src, *limit;
-  const cpp_token **dest, **first;
+  cpp_token *dest, *first;
   macro_arg *arg;
   _cpp_buff *buff;
   unsigned int count;
+  const struct line_map *map;
 
   /* First, fully macro-expand arguments, calculating the number of
      tokens in the final expansion as we go.  The ordering of the if
@@ -966,18 +995,24 @@
 
   /* Now allocate space for the expansion, copy the tokens and replace
      the arguments.  */
-  buff = _cpp_get_buff (pfile, total * sizeof (cpp_token *));
-  first = (const cpp_token **) buff->base;
+  buff = _cpp_get_buff (pfile, total * sizeof (cpp_token));
+  first = (cpp_token *) buff->base;
   dest = first;
 
-  for (src = macro->exp.tokens; src < limit; src++)
+  map = linemap_enter_macro (pfile->line_table, macro, macro_loc, total);
+  i = 0;
+  for (src = macro->exp.tokens; src < limit; src++, i++)
     {
       unsigned int count;
-      const cpp_token **from, **paste_flag;
+      const cpp_token **from;
+      cpp_token *paste_flag;
 
       if (src->type != CPP_MACRO_ARG)
 	{
-	  *dest++ = src;
+	  *dest = *src;
+	  dest->src_loc = linemap_add_macro_token (map, i, dest->src_loc,
+						   dest->src_loc);
+	  ++dest;
 	  continue;
 	}
 
@@ -992,7 +1027,7 @@
 	  count = arg->count, from = arg->first;
 	  if (dest != first)
 	    {
-	      if (dest[-1]->type == CPP_COMMA
+	      if (dest[-1].type == CPP_COMMA
 		  && macro->variadic
 		  && src->val.macro_arg.arg_no == macro->paramc)
 		{
@@ -1014,12 +1049,23 @@
       /* Padding on the left of an argument (unless RHS of ##).  */
       if ((!pfile->state.in_directive || pfile->state.directive_wants_padding)
 	  && src != macro->exp.tokens && !(src[-1].flags & PASTE_LEFT))
-	*dest++ = padding_token (pfile, src);
+	{
+	  *dest = *padding_token (pfile, src);
+	  dest->src_loc = linemap_add_macro_token (map, i, dest->src_loc,
+						   dest->src_loc);
+	  ++dest;
+	}
 
       if (count)
 	{
-	  memcpy (dest, from, count * sizeof (cpp_token *));
-	  dest += count;
+	  unsigned int j;
+	  for (j = 0; j < count; ++j)
+	    {
+	      *dest = *from[j];
+	      dest->src_loc = linemap_add_macro_token (map, i, dest->src_loc,
+						       src->src_loc);
+	      ++dest;
+	    }
 
 	  /* With a non-empty argument on the LHS of ##, the last
 	     token should be flagged PASTE_LEFT.  */
@@ -1040,28 +1086,30 @@
 
       /* Avoid paste on RHS (even case count == 0).  */
       if (!pfile->state.in_directive && !(src->flags & PASTE_LEFT))
-	*dest++ = &pfile->avoid_paste;
+	{
+	  *dest = pfile->avoid_paste;
+	  /* Don't bother changing the location here.  */
+	  ++dest;
+	}
 
       /* Add a new paste flag, or remove an unwanted one.  */
       if (paste_flag)
 	{
-	  cpp_token *token = _cpp_temp_token (pfile);
-	  token->type = (*paste_flag)->type;
-	  token->val = (*paste_flag)->val;
 	  if (src->flags & PASTE_LEFT)
-	    token->flags = (*paste_flag)->flags | PASTE_LEFT;
+	    paste_flag->flags |= PASTE_LEFT;
 	  else
-	    token->flags = (*paste_flag)->flags & ~PASTE_LEFT;
-	  *paste_flag = token;
+	    paste_flag->flags &= ~PASTE_LEFT;
 	}
     }
+  linemap_leave_macro (pfile->line_table, paren_loc);
 
   /* Free the expanded arguments.  */
   for (i = 0; i < macro->paramc; i++)
     if (args[i].expanded)
       free (args[i].expanded);
 
-  push_ptoken_context (pfile, node, buff, first, dest - first);
+  /* FIXME: doesn't handle BUFF */
+  _cpp_push_token_context (pfile, node, first, dest - first);
 }
 
 /* Return a special padding token, with padding inherited from SOURCE.  */
@@ -1221,8 +1269,6 @@
 cpp_get_token (cpp_reader *pfile)
 {
   const cpp_token *result;
-  bool can_set = pfile->set_invocation_location;
-  pfile->set_invocation_location = false;
 
   for (;;)
     {
@@ -1269,10 +1315,6 @@
       if (!(node->flags & NODE_DISABLED))
 	{
 	  int ret = 0;
-	  /* If not in a macro context, and we're going to start an
-	     expansion, record the location.  */
-	  if (can_set && !context->macro)
-	    pfile->invocation_location = result->src_loc;
 	  if (pfile->state.prevent_expansion)
 	    break;
 
@@ -1331,27 +1373,6 @@
   return result;
 }
 
-/* Like cpp_get_token, but also returns a location separate from the
-   one provided by the returned token.  LOC is an out parameter; *LOC
-   is set to the location "as expected by the user".  This matters
-   when a token results from macro expansion -- the token's location
-   will indicate where the macro is defined, but *LOC will be the
-   location of the start of the expansion.  */
-const cpp_token *
-cpp_get_token_with_location (cpp_reader *pfile, source_location *loc)
-{
-  const cpp_token *result;
-
-  pfile->set_invocation_location = true;
-  result = cpp_get_token (pfile);
-  if (pfile->context->macro)
-    *loc = pfile->invocation_location;
-  else
-    *loc = result->src_loc;
-
-  return result;
-}
-
 /* Returns true if we're expanding an object-like macro that was
    defined in a system header.  Just checks the macro at the top of
    the stack.  Used for diagnostic suppression.  */
@@ -1846,6 +1867,7 @@
       (sizeof (cpp_macro));
   else
     macro = (cpp_macro *) _cpp_aligned_alloc (pfile, sizeof (cpp_macro));
+  macro->name = node;
   macro->line = pfile->directive_line;
   macro->params = 0;
   macro->paramc = 0;
Index: libcpp/directives.c
===================================================================
--- libcpp/directives.c	(revision 148688)
+++ libcpp/directives.c	(working copy)
@@ -878,9 +878,9 @@
   /* skip_rest_of_line() may cause line table to be realloc()ed so note down
      sysp right now.  */
 
-  unsigned char map_sysp = map->sysp;
+  unsigned char map_sysp = map->d.ordinary.sysp;
   const cpp_token *token;
-  const char *new_file = map->to_file;
+  const char *new_file = map->d.ordinary.to_file;
   linenum_type new_lineno;
 
   /* C99 raised the minimum limit on #line numbers.  */
@@ -937,9 +937,9 @@
   const struct line_maps *line_table = pfile->line_table;
   const struct line_map *map = &line_table->maps[line_table->used - 1];
   const cpp_token *token;
-  const char *new_file = map->to_file;
+  const char *new_file = map->d.ordinary.to_file;
   linenum_type new_lineno;
-  unsigned int new_sysp = map->sysp;
+  unsigned int new_sysp = map->d.ordinary.sysp;
   enum lc_reason reason = LC_RENAME_VERBATIM;
   int flag;
   bool wrapped;
@@ -1027,7 +1027,7 @@
   const struct line_map *map = linemap_add (pfile->line_table, reason, sysp,
 					    to_file, file_line);
   if (map != NULL)
-    linemap_line_start (pfile->line_table, map->to_line, 127);
+    linemap_line_start (pfile->line_table, map->d.ordinary.to_line, 127);
 
   if (pfile->cb.file_change)
     pfile->cb.file_change (pfile, map);
Index: libcpp/include/cpplib.h
===================================================================
--- libcpp/include/cpplib.h	(revision 148688)
+++ libcpp/include/cpplib.h	(working copy)
@@ -715,8 +715,6 @@
 extern int cpp_avoid_paste (cpp_reader *, const cpp_token *,
 			    const cpp_token *);
 extern const cpp_token *cpp_get_token (cpp_reader *);
-extern const cpp_token *cpp_get_token_with_location (cpp_reader *,
-						     source_location *);
 extern const unsigned char *cpp_macro_definition (cpp_reader *,
 						  const cpp_hashnode *);
 extern void _cpp_backup_tokens (cpp_reader *, unsigned int);
Index: libcpp/include/line-map.h
===================================================================
--- libcpp/include/line-map.h	(revision 148688)
+++ libcpp/include/line-map.h	(working copy)
@@ -37,43 +37,83 @@
    name or line number changes for neither of the above reasons
    (e.g. a #line directive in C); LC_RENAME_VERBATIM is like LC_RENAME
    but a filename of "" is not specially interpreted as standard input.  */
-enum lc_reason {LC_ENTER = 0, LC_LEAVE, LC_RENAME, LC_RENAME_VERBATIM};
+enum lc_reason
+{
+  LC_ENTER = 0,
+  LC_LEAVE,
+  LC_RENAME,
+  LC_RENAME_VERBATIM,
+  LC_ENTER_MACRO
+  /* stringize */
+  /* paste */
+};
 
 /* The type of line numbers.  */
 typedef unsigned int linenum_type;
 
 /* A logical line/column number, i.e. an "index" into a line_map.  */
-/* Long-term, we want to use this to replace struct location_s (in input.h),
-   and effectively typedef source_location location_t.  */
 typedef unsigned int source_location;
 
 /* Memory allocation function typedef.  Works like xrealloc.  */
 typedef void *(*line_map_realloc) (void *, size_t);
 
-/* Physical source file TO_FILE at line TO_LINE at column 0 is represented
+/* An ordinary line map encodes physical source locations.
+   
+   Physical source file TO_FILE at line TO_LINE at column 0 is represented
    by the logical START_LOCATION.  TO_LINE+L at column C is represented by
    START_LOCATION+(L*(1<<column_bits))+C, as long as C<(1<<column_bits),
    and the result_location is less than the next line_map's start_location.
    (The top line is line 1 and the leftmost column is column 1; line/column 0
    means "entire file/line" or "unknown line/column" or "not applicable".)
-   INCLUDED_FROM is an index into the set that gives the line mapping
-   at whose end the current one was included.  File(s) at the bottom
-   of the include stack have this set to -1.  REASON is the reason for
-   creation of this line map, SYSP is one for a system header, two for
-   a C system header file that therefore needs to be extern "C"
-   protected in C++, and zero otherwise.  */
-struct GTY(()) line_map {
+*/
+struct GTY(()) line_map_ordinary
+{
   const char *to_file;
   linenum_type to_line;
-  source_location start_location;
+
+  /* An index into the set that gives the line mapping at whose end
+     the current one was included.  File(s) at the bottom of the
+     include stack have this set to -1.  */
   int included_from;
-  ENUM_BITFIELD (lc_reason) reason : CHAR_BIT;
-  /* The sysp field isn't really needed now that it's in cpp_buffer.  */
+
+  /* SYSP is one for a system header, two for a C system header file
+     that therefore needs to be extern "C" protected in C++, and zero
+     otherwise.  This field isn't really needed now that it's in
+     cpp_buffer.  */
   unsigned char sysp;
-  /* Number of the low-order source_location bits used for a column number.  */
+
+  /* Number of the low-order source_location bits used for a column
+     number.  */
   unsigned int column_bits : 8;
 };
 
+struct cpp_macro;
+
+/* A macro line map encodes locations coming from a macro expansion.
+   
+   Here, the offset from START_LOCATION is used to index into
+   MACRO_LOCATIONS; this holds the original location of the token.  */
+struct GTY(()) line_map_macro
+{
+  struct cpp_macro *macro;
+  unsigned int n_tokens;
+  source_location * GTY((length ("%h.n_tokens"))) macro_locations;
+  source_location expansion;
+};
+
+/* A line_map encodes a sequence of locations.  */
+struct GTY(()) line_map {
+  source_location start_location;
+
+  /* The reason for creation of this line map.  */
+  ENUM_BITFIELD (lc_reason) reason : CHAR_BIT;
+
+  union {
+    struct line_map_ordinary GTY((tag ("0"))) ordinary;
+    struct line_map_macro GTY((tag ("1"))) macro;
+  } GTY((desc ("%1.reason == LC_ENTER_MACRO"))) d;
+};
+
 /* A set of chronological line_map structures.  */
 struct GTY(()) line_maps {
   struct line_map * GTY ((length ("%h.used"))) maps;
@@ -82,11 +122,6 @@
 
   unsigned int cache;
 
-  /* The most recently listed include stack, if any, starts with
-     LAST_LISTED as the topmost including file.  -1 indicates nothing
-     has been listed yet.  */
-  int last_listed;
-
   /* Depth of the include stack, including the current file.  */
   unsigned int depth;
 
@@ -142,17 +177,34 @@
   (struct line_maps *, enum lc_reason, unsigned int sysp,
    const char *to_file, linenum_type to_line);
 
+extern const struct line_map *linemap_enter_macro (struct line_maps *,
+						   void *, source_location,
+						   unsigned int);
+
+extern source_location linemap_add_macro_token (const struct line_map *,
+						unsigned int,
+						source_location,
+						source_location);
+
+extern void linemap_leave_macro (struct line_maps *, source_location);
+
 /* Given a logical line, returns the map from which the corresponding
    (source file, line) pair can be deduced.  */
 extern const struct line_map *linemap_lookup
   (struct line_maps *, source_location);
 
+extern int linemap_check_ordinary (const struct line_map *);
+
 /* Converts a map and a source_location to source line.  */
-#define SOURCE_LINE(MAP, LOC) \
-  ((((LOC) - (MAP)->start_location) >> (MAP)->column_bits) + (MAP)->to_line)
+#define SOURCE_LINE(MAP, LOC)						\
+  (linemap_check_ordinary (MAP),					\
+   ((((LOC) - (MAP)->start_location)					\
+     >> (MAP)->d.ordinary.column_bits) + (MAP)->d.ordinary.to_line))
 
-#define SOURCE_COLUMN(MAP, LOC) \
-  (((LOC) - (MAP)->start_location) & ((1 << (MAP)->column_bits) - 1))
+#define SOURCE_COLUMN(MAP, LOC)				\
+  (linemap_check_ordinary (MAP),			\
+  (((LOC) - (MAP)->start_location)			\
+   & ((1 << (MAP)->d.ordinary.column_bits) - 1)))
 
 /* Returns the last source line within a map.  This is the (last) line
    of the #include, or other directive, that caused a map change.  */
@@ -160,16 +212,21 @@
   SOURCE_LINE (MAP, LAST_SOURCE_LINE_LOCATION (MAP))
 #define LAST_SOURCE_COLUMN(MAP) \
   SOURCE_COLUMN (MAP, LAST_SOURCE_LINE_LOCATION (MAP))
-#define LAST_SOURCE_LINE_LOCATION(MAP) \
-  ((((MAP)[1].start_location - 1 - (MAP)->start_location) \
-    & ~((1 << (MAP)->column_bits) - 1))			  \
-   + (MAP)->start_location)
+#define LAST_SOURCE_LINE_LOCATION(MAP)				\
+  (linemap_check_ordinary (MAP),				\
+   ((((MAP)[1].start_location - 1 - (MAP)->start_location)	\
+     & ~((1 << (MAP)->d.ordinary.column_bits) - 1))		\
+    + (MAP)->start_location))
 
 /* Returns the map a given map was included from.  */
-#define INCLUDED_FROM(SET, MAP) (&(SET)->maps[(MAP)->included_from])
+#define INCLUDED_FROM(SET, MAP)				\
+  (linemap_check_ordinary (MAP),			\
+   (&(SET)->maps[(MAP)->d.ordinary.included_from]))
 
 /* Nonzero if the map is at the bottom of the include stack.  */
-#define MAIN_FILE_P(MAP) ((MAP)->included_from < 0)
+#define MAIN_FILE_P(MAP)			\
+  (linemap_check_ordinary (MAP),		\
+   ((MAP)->d.ordinary.included_from < 0))
 
 /* Set LOC to a source position that is the same line as the most recent
    linemap_line_start, but with the specified TO_COLUMN column number.  */
@@ -191,6 +248,36 @@
 extern source_location
 linemap_position_for_column (struct line_maps *set, unsigned int to_column);
 
+
+#define LINEMAP_FILE(MAP)					\
+  (linemap_check_ordinary (MAP), (MAP)->d.ordinary.to_file)
+
+#define LINEMAP_LINE(MAP)					\
+  (linemap_check_ordinary (MAP), (MAP)->d.ordinary.to_line)
+
+#define LINEMAP_SYSP(MAP)					\
+  (linemap_check_ordinary (MAP), (MAP)->d.ordinary.sysp)
+
+/* FIXME: add assertion.  */
+#define LINEMAP_MACRO_NAME(MAP) (NODE_NAME ((MAP)->d.macro.macro->name))
+
+typedef struct GTY (())
+{
+  /* The name of the source file involved.  */
+  const char *file;
+
+  /* The line-location in the source file.  */
+  int line;
+
+  int column;
+
+  /* In a system header?. */
+  bool sysp;
+} expanded_location;
+
+extern expanded_location linemap_expand_location (struct line_maps *,
+						  source_location);
+
 #ifdef __cplusplus
 }
 #endif
Index: libcpp/include/cpp-id-data.h
===================================================================
--- libcpp/include/cpp-id-data.h	(revision 148688)
+++ libcpp/include/cpp-id-data.h	(working copy)
@@ -38,6 +38,12 @@
 /* Each macro definition is recorded in a cpp_macro structure.
    Variadic macros cannot occur with traditional cpp.  */
 struct GTY(()) cpp_macro {
+  /* Name of this macro.  Used only for error reporting.  */
+  cpp_hashnode * GTY ((nested_ptr (union tree_node,
+		"%h ? CPP_HASHNODE (GCC_IDENT_TO_HT_IDENT (%h)) : NULL",
+				   "%h ? HT_IDENT_TO_GCC_IDENT (HT_NODE (%h)) : NULL")))
+    name;
+
   /* Parameters, if any.  */
   cpp_hashnode ** GTY ((nested_ptr (union tree_node,
 		"%h ? CPP_HASHNODE (GCC_IDENT_TO_HT_IDENT (%h)) : NULL",
Index: libcpp/line-map.c
===================================================================
--- libcpp/line-map.c	(revision 148688)
+++ libcpp/line-map.c	(working copy)
@@ -24,6 +24,12 @@
 #include "system.h"
 #include "line-map.h"
 
+#define linemap_assert(EXPR)			\
+  do {						\
+    if (! (EXPR))				\
+      abort ();					\
+  } while (0)
+
 static void trace_include (const struct line_maps *, const struct line_map *);
 
 /* Initialize a line map set.  */
@@ -34,7 +40,6 @@
   set->maps = NULL;
   set->allocated = 0;
   set->used = 0;
-  set->last_listed = -1;
   set->trace_includes = false;
   set->depth = 0;
   set->cache = 0;
@@ -55,7 +60,7 @@
   for (map = &set->maps[set->used - 1]; ! MAIN_FILE_P (map);
        map = INCLUDED_FROM (set, map))
     fprintf (stderr, "line-map.c: file \"%s\" entered but not left\n",
-	     map->to_file);
+	     map->d.ordinary.to_file);
 }
  
 /* Free a line map set.  */
@@ -71,29 +76,9 @@
     }
 }
 
-/* Add a mapping of logical source line to physical source file and
-   line number.
-
-   The text pointed to by TO_FILE must have a lifetime
-   at least as long as the final call to lookup_line ().  An empty
-   TO_FILE means standard input.  If reason is LC_LEAVE, and
-   TO_FILE is NULL, then TO_FILE, TO_LINE and SYSP are given their
-   natural values considering the file we are returning to.
-
-   FROM_LINE should be monotonic increasing across calls to this
-   function.  A call to this function can relocate the previous set of
-   maps, so any stored line_map pointers should not be used.  */
-
-const struct line_map *
-linemap_add (struct line_maps *set, enum lc_reason reason,
-	     unsigned int sysp, const char *to_file, linenum_type to_line)
+static struct line_map *
+new_linemap (struct line_maps *set)
 {
-  struct line_map *map;
-  source_location start_location = set->highest_location + 1;
-
-  if (set->used && start_location < set->maps[set->used - 1].start_location)
-    abort ();
-
   if (set->used == set->allocated)
     {
       line_map_realloc reallocator
@@ -107,8 +92,22 @@
 					 * sizeof (struct line_map)));
     }
 
-  map = &set->maps[set->used];
+  return &set->maps[set->used++];
+}
 
+static const struct line_map *
+do_add (struct line_maps *set, enum lc_reason reason,
+	unsigned int sysp, const char *to_file, linenum_type to_line,
+	const struct line_map *previous)
+{
+  struct line_map *map;
+  source_location start_location = set->highest_location + 1;
+
+  if (set->used && start_location < set->maps[set->used - 1].start_location)
+    abort ();
+
+  map = new_linemap (set);
+
   if (to_file && *to_file == '\0' && reason != LC_RENAME_VERBATIM)
     to_file = "<stdin>";
 
@@ -129,6 +128,7 @@
 	  if (to_file == NULL)
 	    {
 	      set->depth--;
+	      set->used--;
 	      return NULL;
 	    }
 	  error = true;
@@ -138,7 +138,8 @@
       else
 	{
 	  from = INCLUDED_FROM (set, map - 1);
-	  error = to_file && strcmp (from->to_file, to_file);
+	  linemap_check_ordinary (from);
+	  error = to_file && strcmp (from->d.ordinary.to_file, to_file);
 	}
 
       /* Depending upon whether we are handling preprocessed input or
@@ -150,42 +151,145 @@
       /* A TO_FILE of NULL is special - we use the natural values.  */
       if (error || to_file == NULL)
 	{
-	  to_file = from->to_file;
+	  linemap_check_ordinary (from);
+	  to_file = from->d.ordinary.to_file;
 	  to_line = SOURCE_LINE (from, from[1].start_location);
-	  sysp = from->sysp;
+	  sysp = from->d.ordinary.sysp;
 	}
     }
 
+  linemap_assert (reason != LC_ENTER_MACRO);
   map->reason = reason;
-  map->sysp = sysp;
+  map->d.ordinary.sysp = sysp;
   map->start_location = start_location;
-  map->to_file = to_file;
-  map->to_line = to_line;
-  set->cache = set->used++;
-  map->column_bits = 0;
+  map->d.ordinary.to_file = to_file;
+  map->d.ordinary.to_line = to_line;
+  set->cache = set->used - 1;
+  map->d.ordinary.column_bits = 0;
   set->highest_location = start_location;
   set->highest_line = start_location;
   set->max_column_hint = 0;
 
   if (reason == LC_ENTER)
     {
-      map->included_from = set->depth == 0 ? -1 : (int) (set->used - 2);
+      map->d.ordinary.included_from
+	= set->depth == 0 ? -1 : (int) (set->used - 2);
       set->depth++;
       if (set->trace_includes)
 	trace_include (set, map);
     }
   else if (reason == LC_RENAME)
-    map->included_from = map[-1].included_from;
+    {
+      if (previous == NULL)
+	previous = &map[-1];
+      linemap_check_ordinary (previous);
+      map->d.ordinary.included_from = previous->d.ordinary.included_from;
+    }
   else if (reason == LC_LEAVE)
     {
       set->depth--;
-      map->included_from = INCLUDED_FROM (set, map - 1)->included_from;
+      map->d.ordinary.included_from
+	= INCLUDED_FROM (set, map - 1)->d.ordinary.included_from;
     }
 
   return map;
 }
 
+/* Add a mapping of logical source line to physical source file and
+   line number.
+
+   The text pointed to by TO_FILE must have a lifetime
+   at least as long as the final call to lookup_line ().  An empty
+   TO_FILE means standard input.  If reason is LC_LEAVE, and
+   TO_FILE is NULL, then TO_FILE, TO_LINE and SYSP are given their
+   natural values considering the file we are returning to.
+
+   FROM_LINE should be monotonic increasing across calls to this
+   function.  A call to this function can relocate the previous set of
+   maps, so any stored line_map pointers should not be used.  */
+
+const struct line_map *
+linemap_add (struct line_maps *set, enum lc_reason reason,
+	     unsigned int sysp, const char *to_file, linenum_type to_line)
+{
+  return do_add (set, reason, sysp, to_file, to_line, NULL);
+}
+
+const struct line_map *
+linemap_enter_macro (struct line_maps *set, void *macro,
+		     source_location expansion, unsigned int num_tokens)
+{
+  struct line_map *map;
+  source_location start_location = set->highest_location + 1;
+  line_map_realloc reallocator
+    = set->reallocator ? set->reallocator : xrealloc;
+
+  map = new_linemap (set);
+
+  map->start_location = start_location;
+  map->reason = LC_ENTER_MACRO;
+  map->d.macro.macro = macro;
+  map->d.macro.n_tokens = num_tokens;
+  map->d.macro.macro_locations
+    = reallocator (NULL, 2 * num_tokens * sizeof (source_location));
+  map->d.macro.expansion = expansion;
+  memset (map->d.macro.macro_locations, 0,
+	  num_tokens * sizeof (source_location));
+
+  set->cache = set->used - 1;
+  set->max_column_hint = 0;
+  set->highest_location = start_location + num_tokens;
+  set->highest_line = start_location + num_tokens;
+
+  return map;
+}
+
 source_location
+linemap_add_macro_token (const struct line_map *map,
+			 unsigned int token_no,
+			 source_location orig,
+			 source_location other /* FIXME name */)
+{
+  linemap_assert (map->reason == LC_ENTER_MACRO);
+  map->d.macro.macro_locations[2 * token_no] = orig;
+  map->d.macro.macro_locations[2 * token_no + 1] = other;
+  return map->start_location + token_no;
+}
+
+static const struct line_map *
+find_macro_base (struct line_maps *set, source_location loc, int expansion)
+{
+  while (1)
+    {
+      const struct line_map *map;
+      map = linemap_lookup (set, loc);
+      if (map->reason != LC_ENTER_MACRO)
+	return map;
+      if (expansion)
+	loc = map->d.macro.expansion;
+      else
+	loc = map->d.macro.macro_locations[2 * (loc - map->start_location)];
+    }
+}
+
+void
+linemap_leave_macro (struct line_maps *set, source_location paren_loc)
+{
+  const struct line_map *base, *paren;
+
+  linemap_assert (set->maps[set->used - 1].reason == LC_ENTER_MACRO);
+
+/*   base = find_macro_base (set, set->maps[set->used - 1].d.macro.expansion, 1); */
+  base = &set->maps[set->used - 2];
+  linemap_assert (base->reason != LC_ENTER_MACRO);
+
+  linemap_assert (base->reason != LC_ENTER_MACRO);
+  paren = find_macro_base (set, paren_loc, 0);
+  do_add (set, LC_RENAME, base->d.ordinary.sysp,
+	  base->d.ordinary.to_file, SOURCE_LINE (paren, paren_loc), base);
+}
+
+source_location
 linemap_line_start (struct line_maps *set, linenum_type to_line,
 		    unsigned int max_column_hint)
 {
@@ -195,10 +299,13 @@
   linenum_type last_line = SOURCE_LINE (map, set->highest_line);
   int line_delta = to_line - last_line;
   bool add_map = false;
+
+  linemap_check_ordinary (map);
+
   if (line_delta < 0
-      || (line_delta > 10 && line_delta * map->column_bits > 1000)
-      || (max_column_hint >= (1U << map->column_bits))
-      || (max_column_hint <= 80 && map->column_bits >= 10))
+      || (line_delta > 10 && line_delta * map->d.ordinary.column_bits > 1000)
+      || (max_column_hint >= (1U << map->d.ordinary.column_bits))
+      || (max_column_hint <= 80 && map->d.ordinary.column_bits >= 10))
     {
       add_map = true;
     }
@@ -226,16 +333,19 @@
       /* Allocate the new line_map.  However, if the current map only has a
 	 single line we can sometimes just increase its column_bits instead. */
       if (line_delta < 0
-	  || last_line != map->to_line
+	  || last_line != map->d.ordinary.to_line
 	  || SOURCE_COLUMN (map, highest) >= (1U << column_bits))
-	map = (struct line_map *) linemap_add (set, LC_RENAME, map->sysp,
-					       map->to_file, to_line);
-      map->column_bits = column_bits;
-      r = map->start_location + ((to_line - map->to_line) << column_bits);
+	map = (struct line_map *) linemap_add (set, LC_RENAME,
+					       map->d.ordinary.sysp,
+					       map->d.ordinary.to_file,
+					       to_line);
+      map->d.ordinary.column_bits = column_bits;
+      r = map->start_location + ((to_line - map->d.ordinary.to_line)
+				 << column_bits);
     }
   else
     r = highest - SOURCE_COLUMN (map, highest)
-      + (line_delta << map->column_bits);
+      + (line_delta << map->d.ordinary.column_bits);
   set->highest_line = r;
   if (r > set->highest_location)
     set->highest_location = r;
@@ -247,6 +357,9 @@
 linemap_position_for_column (struct line_maps *set, unsigned int to_column)
 {
   source_location r = set->highest_line;
+
+  linemap_assert (set->maps[set->used - 1].reason != LC_ENTER_MACRO);
+
   if (to_column >= set->max_column_hint)
     {
       if (r >= 0xC000000 || to_column > 100000)
@@ -306,6 +419,14 @@
   return &set->maps[mn];
 }
 
+int
+linemap_check_ordinary (const struct line_map *map)
+{
+  linemap_assert (map->reason != LC_ENTER_MACRO);
+  /* Return any old value.  */
+  return 0;
+}
+
 /* Print an include trace, for e.g. the -H option of the preprocessor.  */
 
 static void
@@ -315,5 +436,43 @@
 
   while (--i)
     putc ('.', stderr);
-  fprintf (stderr, " %s\n", map->to_file);
+  linemap_check_ordinary (map);
+  fprintf (stderr, " %s\n", map->d.ordinary.to_file);
 }
+
+expanded_location
+linemap_expand_location (struct line_maps *set, source_location loc)
+{
+  expanded_location xloc;
+  if (loc == 0)
+    {
+      xloc.file = NULL;
+      xloc.line = 0;
+      xloc.column = 0;
+      xloc.sysp = 0;
+    }
+  else
+    {
+      const struct line_map *map;
+      while (1)
+	{
+	  unsigned int token;
+
+	  map = linemap_lookup (set, loc);
+	  if (map->reason != LC_ENTER_MACRO)
+	    break;
+	  token = loc - map->start_location;
+	  linemap_assert (token < map->d.macro.n_tokens);
+	  /* FIXME?? when we have 2 locs */
+	  if (map->d.macro.macro_locations[2 * token] > map->d.macro.expansion)
+	    loc = map->d.macro.macro_locations[2 * token];
+	  else
+	    loc = map->d.macro.expansion;
+	}
+      xloc.file = LINEMAP_FILE (map);
+      xloc.line = SOURCE_LINE (map, loc);
+      xloc.column = SOURCE_COLUMN (map, loc);
+      xloc.sysp = LINEMAP_SYSP (map) != 0;
+    }
+  return xloc;
+}
Index: libcpp/files.c
===================================================================
--- libcpp/files.c	(revision 148688)
+++ libcpp/files.c	(working copy)
@@ -1208,7 +1208,7 @@
   if (syshdr)
     flags = 1 + (externc != 0);
   pfile->buffer->sysp = flags;
-  _cpp_do_file_change (pfile, LC_RENAME, map->to_file,
+  _cpp_do_file_change (pfile, LC_RENAME, map->d.ordinary.to_file,
 		       SOURCE_LINE (map, pfile->line_table->highest_line), flags);
 }
 
Index: libcpp/init.c
===================================================================
--- libcpp/init.c	(revision 148688)
+++ libcpp/init.c	(working copy)
@@ -555,7 +555,7 @@
   if (CPP_OPTION (pfile, preprocessed))
     {
       read_original_filename (pfile);
-      fname = pfile->line_table->maps[pfile->line_table->used-1].to_file;
+      fname = pfile->line_table->maps[pfile->line_table->used-1].d.ordinary.to_file;
     }
   return fname;
 }
Index: libcpp/internal.h
===================================================================
--- libcpp/internal.h	(revision 148688)
+++ libcpp/internal.h	(working copy)
@@ -340,14 +340,6 @@
   /* Token generated while handling a directive, if any. */
   cpp_token directive_result;
 
-  /* When expanding a macro at top-level, this is the location of the
-     macro invocation.  */
-  source_location invocation_location;
-
-  /* True if this call to cpp_get_token should consider setting
-     invocation_location.  */
-  bool set_invocation_location;
-
   /* Search paths for include files.  */
   struct cpp_dir *quote_include;	/* "" */
   struct cpp_dir *bracket_include;	/* <> */

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-15 17:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-15 13:12 handling of TAB in column number Arnaud Charlet
2009-11-15 17:25 ` Tom Tromey
2009-11-15 17:34   ` Arnaud Charlet
2009-11-15 17:59     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).