aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2008-03-13 21:10:07 +0000
committerTom Tromey <tromey@gcc.gnu.org>2008-03-13 21:10:07 +0000
commit14ccf8003e6b3977fc0895bbe80335e5d2bdf8e3 (patch)
tree5f5d1ece2626b71732e651e128c1cd46bd507234
parentca8bfb99cd460bb819a8e711f1cdcaf058106daf (diff)
downloadgcc-14ccf8003e6b3977fc0895bbe80335e5d2bdf8e3.zip
gcc-14ccf8003e6b3977fc0895bbe80335e5d2bdf8e3.tar.gz
gcc-14ccf8003e6b3977fc0895bbe80335e5d2bdf8e3.tar.bz2
re PR preprocessor/35322 (ICE with incomplete macro)
gcc/testsuite PR libcpp/35322: * gcc.dg/cpp/pr35322.c: New file. libcpp PR libcpp/35322: * directives.c (destringize_and_run): Set pfile->directive. From-SVN: r133195
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr35322.c4
-rw-r--r--libcpp/ChangeLog5
-rw-r--r--libcpp/directives.c4
4 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fd8c6d5..862a43e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-13 Tom Tromey <tromey@redhat.com>
+
+ PR libcpp/35322:
+ * gcc.dg/cpp/pr35322.c: New file.
+
2008-03-13 Uros Bizjak <ubizjak@gmail.com>
* gcc.dg/vect/vect-align-2.c: Remove dg-do run directive.
diff --git a/gcc/testsuite/gcc.dg/cpp/pr35322.c b/gcc/testsuite/gcc.dg/cpp/pr35322.c
new file mode 100644
index 0000000..916b4cc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/pr35322.c
@@ -0,0 +1,4 @@
+/* Test case for PR 35322 -- _Pragma ICE. */
+
+/* { dg-do preprocess } */
+_Pragma("GCC dependency")
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index a6be847c..8e8dfe4 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-13 Tom Tromey <tromey@redhat.com>
+
+ PR libcpp/35322:
+ * directives.c (destringize_and_run): Set pfile->directive.
+
2008-03-06 Markus Milleder <markus.milleder@generali.at>
PR preprocessor/35458
diff --git a/libcpp/directives.c b/libcpp/directives.c
index c77e84b..249a232 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -1507,6 +1507,7 @@ destringize_and_run (cpp_reader *pfile, const cpp_string *in)
tokenrun *saved_cur_run;
cpp_token *toks;
int count;
+ const struct directive *save_directive;
dest = result = (char *) alloca (in->len - 1);
src = in->text + 1 + (in->text[0] == 'L');
@@ -1547,8 +1548,11 @@ destringize_and_run (cpp_reader *pfile, const cpp_string *in)
start_directive (pfile);
_cpp_clean_line (pfile);
+ save_directive = pfile->directive;
+ pfile->directive = &dtable[T_PRAGMA];
do_pragma (pfile);
end_directive (pfile, 1);
+ pfile->directive = save_directive;
/* We always insert at least one token, the directive result. It'll
either be a CPP_PADDING or a CPP_PRAGMA. In the later case, we