This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, cpp] Fix pr61817 and 69391
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, David Malcolm <dmalcolm at redhat dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Wed, 6 Apr 2016 16:39:16 +0200
- Subject: Re: [PATCH, cpp] Fix pr61817 and 69391
- Authentication-results: sourceware.org; auth=none
- References: <5703E64D dot 3090503 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Apr 05, 2016 at 09:22:37AM -0700, Richard Henderson wrote:
> These two related PRs are all about remembering where a macro is expanded.
> Worse, we've got two competing goals -- the real location of the expansion,
> for __LINE__, and the virtual location of the expansion, for diagnostics.
>
> There seems to be no way to unify the two competing goals. If we simply
> "fix" the first, we break the second. Therefore, I resort to passing down
> both locations.
>
> Ok?
>
>
> r~
Missing PR numbers here.
> * internal.h (_cpp_builtin_macro_text): Update decl.
> * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
> (builtin_macro): Accept a second location for __LINE__.
> (enter_macro_context): Compute both virtual and real expansion
> locations for the macro.
>
> * gcc.dg/pr61817.c: New test.
> * gcc.dg/pr69391-1.c: New test.
> * gcc.dg/pr69391-2.c: New test.
>
>
> diff --git a/gcc/testsuite/gcc.dg/pr61817.c b/gcc/testsuite/gcc.dg/pr61817.c
> new file mode 100644
> index 0000000..4230485
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/pr61817.c
> @@ -0,0 +1,19 @@
> +/* { dg-do compile } */
> +/* { dg-options "-std=c11 -ftrack-macro-expansion=0" } */
Wouldn't it make sense to provide this test also as -1.c and -2.c, one
with -ftrack-macro-expansion=0 and one with -ftrack-macro-expansion=1?
Otherwise LGTM.
Jakub