aboutsummaryrefslogtreecommitdiff
path: root/libcpp/ChangeLog
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@redhat.com>2012-08-27 15:41:38 +0000
committerDodji Seketeli <dodji@gcc.gnu.org>2012-08-27 17:41:38 +0200
commitf3d25c6570bd19d17757fd8a592188aa7ff6ecb4 (patch)
tree3ced6ccbc7fcd596cb1529873cece3f5076eef5d /libcpp/ChangeLog
parentc0782a4002d2529b76ffe861c5870e2e2c097f5a (diff)
downloadgcc-f3d25c6570bd19d17757fd8a592188aa7ff6ecb4.zip
gcc-f3d25c6570bd19d17757fd8a592188aa7ff6ecb4.tar.gz
gcc-f3d25c6570bd19d17757fd8a592188aa7ff6ecb4.tar.bz2
PR preprocessor/53469 - argument tokens of _Pragma miss virtual location
Consider this short test snippet: -------------------------8------------------- #define STRINGIFY(x) #x #define TEST(x) \ _Pragma(STRINGIFY(GCC diagnostic ignored "-Wunused-local-typedefs")) \ typedef int myint; void bar () { TEST(myint) } -------------------------8------------------- The _Pragma is effectively ignored, and compiling with -Wunused-local-typedefs warns on the local typedef, even though the pragma should have prevented the warning to be emitted. This is because when the preprocessor sees the _Pragma operator and then goes to handle the first token ('GCC' here) that makes up its operands, it retains the spelling location of that token, not its virtual location. Later when diagnostic_report_diagnostic is called to emit the warning (or ignore it because of the pragma), it compares the location of the first operand of the pragma with the location of the unused location, (by calling linemap_location_before_p) and that comparison fails because in this case, both locations should be virtual. This patch fixes the issue by teaching the pragma handling to use virtual locations. Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk. libcpp/ PR preprocessor/53469 * directives.c (do_pragma): Use the virtual location for the pragma token, instead of its spelling location. gcc/testsuite/ PR preprocessor/53469 * gcc.dg/cpp/_Pragma7.c: New test case. From-SVN: r190714
Diffstat (limited to 'libcpp/ChangeLog')
-rw-r--r--libcpp/ChangeLog6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index e4da6ef..7c11fdd0 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-25 Dodji Seketeli <dodji@redhat.com>
+
+ PR preprocessor/53469
+ * directives.c (do_pragma): Use the virtual location for the
+ pragma token, instead of its spelling location.
+
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.