diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0398-PR-c-49298.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0398-PR-c-49298.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0398-PR-c-49298.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0398-PR-c-49298.patch new file mode 100644 index 0000000000..777656a1c0 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0398-PR-c-49298.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From f4e84e1c8443edee24be10cea492892f3621933a Mon Sep 17 00:00:00 2001 | ||
2 | From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Mon, 6 Jun 2011 20:07:26 +0000 | ||
4 | Subject: [PATCH] PR c++/49298 | ||
5 | * semantics.c (potential_constant_expression_1): Handle FIELD_DECL. | ||
6 | |||
7 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174722 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
8 | |||
9 | index d56423e..5cb8f49 100644 | ||
10 | --- a/gcc/cp/semantics.c | ||
11 | +++ b/gcc/cp/semantics.c | ||
12 | @@ -7429,6 +7429,8 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags) | ||
13 | case TEMPLATE_PARM_INDEX: | ||
14 | case TRAIT_EXPR: | ||
15 | case IDENTIFIER_NODE: | ||
16 | + /* We can see a FIELD_DECL in a pointer-to-member expression. */ | ||
17 | + case FIELD_DECL: | ||
18 | return true; | ||
19 | |||
20 | case PARM_DECL: | ||
21 | new file mode 100644 | ||
22 | index 0000000..873000b | ||
23 | --- /dev/null | ||
24 | +++ b/gcc/testsuite/g++.dg/cpp0x/regress/ptrmem1.C | ||
25 | @@ -0,0 +1,9 @@ | ||
26 | +// PR c++/49298 | ||
27 | +// { dg-options -std=c++0x } | ||
28 | + | ||
29 | +template <class T, int T::*> struct B { }; | ||
30 | +template <class T> struct A | ||
31 | +{ | ||
32 | + int i; | ||
33 | + B<A,&A::i> b; | ||
34 | +}; | ||
35 | -- | ||
36 | 1.7.0.4 | ||
37 | |||