This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libcpp PATCH] Fix up location of builtin macros (PR c/61861)


On 07/23/14 07:15, Marek Polacek wrote:
Bultin macros like __FILE__, __DATE__, etc. had wrong locus - always
column 1.  This patch fixes it by giving those macros location
of the expansion point, i.e, the location, where builtin macro is used.
It now also does the correct thing if we do e.g.
#define F __FILE__.

Bootstrapped/regtested on x86_64-linux, ok for trunk?

2014-07-23  Marek Polacek  <polacek@redhat.com>

	PR c/61861
	* macro.c (builtin_macro): Add location parameter.  Set
	location of builtin macro to the expansion point.
	(enter_macro_context): Pass location to builtin_macro.

	* gcc.dg/pr61861.c: New test.
This is fine for the trunk.

Thanks,
jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]