diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0046-PR-c-48212.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0046-PR-c-48212.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0046-PR-c-48212.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0046-PR-c-48212.patch new file mode 100644 index 0000000000..7db61ba6c7 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0046-PR-c-48212.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From f23bf88450af23287387d878036f78042093d61b Mon Sep 17 00:00:00 2001 | ||
2 | From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Wed, 30 Mar 2011 20:29:43 +0000 | ||
4 | Subject: [PATCH 046/200] PR c++/48212 | ||
5 | * semantics.c (non_const_var_error): Just return if DECL_INITIAL | ||
6 | is error_mark_node. | ||
7 | |||
8 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@171749 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
9 | |||
10 | index 48dd4ee..c88b4bb 100644 | ||
11 | --- a/gcc/cp/semantics.c | ||
12 | +++ b/gcc/cp/semantics.c | ||
13 | @@ -6759,6 +6759,9 @@ non_const_var_error (tree r) | ||
14 | tree type = TREE_TYPE (r); | ||
15 | error ("the value of %qD is not usable in a constant " | ||
16 | "expression", r); | ||
17 | + /* Avoid error cascade. */ | ||
18 | + if (DECL_INITIAL (r) == error_mark_node) | ||
19 | + return; | ||
20 | if (DECL_DECLARED_CONSTEXPR_P (r)) | ||
21 | inform (DECL_SOURCE_LOCATION (r), | ||
22 | "%qD used in its own initializer", r); | ||
23 | new file mode 100644 | ||
24 | index 0000000..2094d3e | ||
25 | --- /dev/null | ||
26 | +++ b/gcc/testsuite/g++.dg/cpp0x/regress/error-recovery1.C | ||
27 | @@ -0,0 +1,9 @@ | ||
28 | +// PR c++/48212 | ||
29 | +// { dg-options -std=c++0x } | ||
30 | + | ||
31 | +template < bool > void | ||
32 | +foo () | ||
33 | +{ | ||
34 | + const bool b =; // { dg-error "" } | ||
35 | + foo < b > (); // { dg-error "constant expression" } | ||
36 | +}; | ||
37 | -- | ||
38 | 1.7.0.4 | ||
39 | |||