GCC Bugzilla – Attachment 30459 Details for
Bug 57824
Raw string literals not handled correctly in macro arguments or deferred pragmas
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
gcc49-pr57824.patch
gcc49-pr57824.patch (text/plain), 1.96 KB, created by
Jakub Jelinek
on 2013-07-04 17:36:22 UTC
(
hide
)
Description:
gcc49-pr57824.patch
Filename:
MIME Type:
Creator:
Jakub Jelinek
Created:
2013-07-04 17:36:22 UTC
Size:
1.96 KB
patch
obsolete
>2013-07-04 Jakub Jelinek <jakub@redhat.com> > > PR preprocessor/57824 > * lex.c (lex_raw_string): Allow reading new-lines if > in_deferred_pragma or if parsing_args and there is still > data in the current buffer. > > * c-c++-common/raw-string-17.c: New test. > * c-c++-common/gomp/pr57824.c: New test. > >--- libcpp/lex.c.jj 2013-07-04 18:48:13.000000000 +0200 >+++ libcpp/lex.c 2013-07-04 19:16:26.401312503 +0200 >@@ -1692,8 +1692,8 @@ lex_raw_string (cpp_reader *pfile, cpp_t > else if (c == '\n') > { > if (pfile->state.in_directive >- || pfile->state.parsing_args >- || pfile->state.in_deferred_pragma) >+ || (pfile->state.parsing_args >+ && pfile->buffer->next_line >= pfile->buffer->rlimit)) > { > cur--; > type = CPP_OTHER; >--- gcc/testsuite/c-c++-common/raw-string-17.c.jj 2013-07-04 19:22:07.905695049 +0200 >+++ gcc/testsuite/c-c++-common/raw-string-17.c 2013-07-04 19:26:30.136244380 +0200 >@@ -0,0 +1,30 @@ >+/* PR preprocessor/57824 */ >+/* { dg-do run } */ >+/* { dg-options "-std=gnu99" { target c } } */ >+/* { dg-options "-std=c++11" { target c++ } } */ >+ >+#define S(s) s >+#define T(s) s "\n" >+ >+const char x[] = R"( >+abc >+)"; >+const char y[] = S(R"( >+abc >+)"); >+const char z[] = "\nabc\n"; >+const char w[] = T(R"( >+abc)"); >+ >+int >+main () >+{ >+ if (sizeof x != sizeof y >+ || sizeof x != sizeof z >+ || sizeof x != sizeof w >+ || __builtin_memcmp (x, y, sizeof x) >+ || __builtin_memcmp (x, z, sizeof x) >+ || __builtin_memcmp (x, w, sizeof x)) >+ __builtin_abort (); >+ return 0; >+} >--- gcc/testsuite/c-c++-common/gomp/pr57824.c.jj 2013-07-04 19:30:26.040563509 +0200 >+++ gcc/testsuite/c-c++-common/gomp/pr57824.c 2013-07-04 19:30:56.928056024 +0200 >@@ -0,0 +1,14 @@ >+/* PR preprocessor/57824 */ >+/* { dg-do compile } */ >+/* { dg-options "-std=gnu99 -fopenmp" { target c } } */ >+/* { dg-options "-std=c++11 -fopenmp" { target c++ } } */ >+ >+void bar (); >+ >+void foo () >+{ >+#pragma omp parallel num_threads(sizeof R"( >+abc >+)") >+ bar (); >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 57824
: 30459