diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-5.1/backport/0003-PR66007.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-5.1/backport/0003-PR66007.patch | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-5.1/backport/0003-PR66007.patch b/meta/recipes-devtools/gcc/gcc-5.1/backport/0003-PR66007.patch deleted file mode 100644 index 7c1a19cd7f..0000000000 --- a/meta/recipes-devtools/gcc/gcc-5.1/backport/0003-PR66007.patch +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | From 3b1253116b7cb98da33c997bffa5fa2616aee40a Mon Sep 17 00:00:00 2001 | ||
2 | From: paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Mon, 4 May 2015 20:59:03 +0000 | ||
4 | Subject: [PATCH] /cp 2015-05-04 Paolo Carlini <paolo.carlini@oracle.com> | ||
5 | Jakub Jelinek <jakub@redhat.com> | ||
6 | |||
7 | PR c++/66007 | ||
8 | * typeck2.c (check_narrowing): Check by-hand that the pedwarn didn't | ||
9 | result in an actual error. | ||
10 | |||
11 | /testsuite | ||
12 | 2015-05-04 Paolo Carlini <paolo.carlini@oracle.com> | ||
13 | Jakub Jelinek <jakub@redhat.com> | ||
14 | |||
15 | PR c++/66007 | ||
16 | * g++.dg/cpp0x/Wnarrowing4.C: New. | ||
17 | |||
18 | |||
19 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@222779 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
20 | --- | ||
21 | Upstream-Status: Backport | ||
22 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
23 | |||
24 | gcc/cp/ChangeLog | 7 +++++++ | ||
25 | gcc/cp/typeck2.c | 8 +++++--- | ||
26 | gcc/testsuite/ChangeLog | 6 ++++++ | ||
27 | gcc/testsuite/g++.dg/cpp0x/Wnarrowing4.C | 14 ++++++++++++++ | ||
28 | 4 files changed, 32 insertions(+), 3 deletions(-) | ||
29 | create mode 100644 gcc/testsuite/g++.dg/cpp0x/Wnarrowing4.C | ||
30 | |||
31 | diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c | ||
32 | index 9a491aa..c0df823 100644 | ||
33 | --- a/gcc/cp/typeck2.c | ||
34 | +++ b/gcc/cp/typeck2.c | ||
35 | @@ -958,10 +958,12 @@ check_narrowing (tree type, tree init, tsubst_flags_t complain) | ||
36 | } | ||
37 | else if (complain & tf_error) | ||
38 | { | ||
39 | + int savederrorcount = errorcount; | ||
40 | global_dc->pedantic_errors = 1; | ||
41 | - if (!pedwarn (EXPR_LOC_OR_LOC (init, input_location), OPT_Wnarrowing, | ||
42 | - "narrowing conversion of %qE from %qT to %qT " | ||
43 | - "inside { }", init, ftype, type)) | ||
44 | + pedwarn (EXPR_LOC_OR_LOC (init, input_location), OPT_Wnarrowing, | ||
45 | + "narrowing conversion of %qE from %qT to %qT " | ||
46 | + "inside { }", init, ftype, type); | ||
47 | + if (errorcount == savederrorcount) | ||
48 | ok = true; | ||
49 | global_dc->pedantic_errors = flag_pedantic_errors; | ||
50 | } | ||
51 | diff --git a/gcc/testsuite/g++.dg/cpp0x/Wnarrowing4.C b/gcc/testsuite/g++.dg/cpp0x/Wnarrowing4.C | ||
52 | new file mode 100644 | ||
53 | index 0000000..7defce3 | ||
54 | --- /dev/null | ||
55 | +++ b/gcc/testsuite/g++.dg/cpp0x/Wnarrowing4.C | ||
56 | @@ -0,0 +1,14 @@ | ||
57 | +// PR c++/66007 | ||
58 | +// { dg-do run { target c++11 } } | ||
59 | +// { dg-options "-Wno-error=narrowing" } | ||
60 | + | ||
61 | +extern "C" void abort(); | ||
62 | + | ||
63 | +int main() | ||
64 | +{ | ||
65 | + unsigned foo[] = { 1, -1, 3 }; | ||
66 | + if (foo[0] != 1 || foo[1] != __INT_MAX__ * 2U + 1 || foo[2] != 3) | ||
67 | + abort(); | ||
68 | +} | ||
69 | + | ||
70 | +// { dg-prune-output "narrowing conversion" } | ||
71 | -- | ||
72 | 2.1.4 | ||
73 | |||