diff options
author | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-07-17 20:10:57 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-07-17 20:10:57 +0200 |
commit | 0c86a39db2888ddd17b21d0822b0907e4661d8b6 (patch) | |
tree | f900c8a020892d4af02d171ffe5ed7c3a00eb702 /gcc | |
parent | 0ef03fe3d09f799b457eccf83247976e9a6da77d (diff) | |
download | gcc-0c86a39db2888ddd17b21d0822b0907e4661d8b6.zip gcc-0c86a39db2888ddd17b21d0822b0907e4661d8b6.tar.gz gcc-0c86a39db2888ddd17b21d0822b0907e4661d8b6.tar.bz2 |
lex.c (_cpp_lex_direct): Use CPP_DL_NOTE instead of CPP_DL_PEDWARN...
* lex.c (_cpp_lex_direct): Use CPP_DL_NOTE instead of CPP_DL_PEDWARN,
CPP_DL_WARNING or CPP_DL_ERROR for note that diagnostics for C++ style
comments is reported only once per file and guard those calls on the
preceding cpp_error returning true.
* gcc.dg/cpp/pr61854-c90.c (foo): Expect a note, rather than error.
* gcc.dg/cpp/pr61854-c94.c (foo): Likewise.
* gcc.dg/cpp/pr61854-4.c (foo): Likewise.
* gcc.dg/cpp/pr61854-8.c: New test.
From-SVN: r262832
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/pr61854-4.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/pr61854-8.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/pr61854-c90.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/pr61854-c94.c | 2 |
5 files changed, 22 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2019039..11936ee 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-07-17 Jakub Jelinek <jakub@redhat.com> + + * gcc.dg/cpp/pr61854-c90.c (foo): Expect a note, rather than error. + * gcc.dg/cpp/pr61854-c94.c (foo): Likewise. + * gcc.dg/cpp/pr61854-4.c (foo): Likewise. + * gcc.dg/cpp/pr61854-8.c: New test. + 2018-07-17 David Edelsohn <dje.gcc@gmail.com> * gcc.target/powerpc/pr85456.c: Require longdouble128. diff --git a/gcc/testsuite/gcc.dg/cpp/pr61854-4.c b/gcc/testsuite/gcc.dg/cpp/pr61854-4.c index 5cfa5a7..3533ae0 100644 --- a/gcc/testsuite/gcc.dg/cpp/pr61854-4.c +++ b/gcc/testsuite/gcc.dg/cpp/pr61854-4.c @@ -12,5 +12,5 @@ foo (void) // But error here. #endif /* { dg-error "C\\+\\+ style comments are not allowed in ISO C90" "comments" { target *-*-*} 12 } */ - /* { dg-error "reported only once" "" { target *-*-*} 12 } */ + /* { dg-message "note: \[^\n\r]*reported only once" "" { target *-*-*} 12 } */ } diff --git a/gcc/testsuite/gcc.dg/cpp/pr61854-8.c b/gcc/testsuite/gcc.dg/cpp/pr61854-8.c new file mode 100644 index 0000000..307513c --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/pr61854-8.c @@ -0,0 +1,12 @@ +/* PR c/61854 */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu89 -pedantic -w" } */ + +int +main (void) +{ + // Comment. + /* { dg-bogus "C\\+\\+ style comments are not allowed in ISO C90" "comments" { target *-*-*} .-1 } */ + /* { dg-bogus "note: \[^\n\r]*reported only once" "" { target *-*-*} .-2 } */ + return 0; +} diff --git a/gcc/testsuite/gcc.dg/cpp/pr61854-c90.c b/gcc/testsuite/gcc.dg/cpp/pr61854-c90.c index d7a9ba5..907e975 100644 --- a/gcc/testsuite/gcc.dg/cpp/pr61854-c90.c +++ b/gcc/testsuite/gcc.dg/cpp/pr61854-c90.c @@ -7,7 +7,7 @@ foo (void) { // 1st /* { dg-error "C\\+\\+ style comments are not allowed in ISO C90" "comments" { target *-*-*} .-1 } */ - /* { dg-error "reported only once" "" { target *-*-*} .-2 } */ + /* { dg-message "note: \[^\n\r]*reported only once" "" { target *-*-*} .-2 } */ // 2nd // 3rd } diff --git a/gcc/testsuite/gcc.dg/cpp/pr61854-c94.c b/gcc/testsuite/gcc.dg/cpp/pr61854-c94.c index bd5ea6e..a8c301d 100644 --- a/gcc/testsuite/gcc.dg/cpp/pr61854-c94.c +++ b/gcc/testsuite/gcc.dg/cpp/pr61854-c94.c @@ -7,7 +7,7 @@ foo (void) { // 1st /* { dg-error "C\\+\\+ style comments are not allowed in ISO C90" "comments" { target *-*-*} .-1 } */ - /* { dg-error "reported only once" "" { target *-*-*} .-2 } */ + /* { dg-message "note: \[^\n\r]*reported only once" "" { target *-*-*} .-2 } */ // 2nd // 3rd } |