diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0326-PR-c-49042.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0326-PR-c-49042.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0326-PR-c-49042.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0326-PR-c-49042.patch new file mode 100644 index 0000000000..3887365cc9 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0326-PR-c-49042.patch | |||
@@ -0,0 +1,63 @@ | |||
1 | From d457a29d66693292b2692aa17f038cce88f8962e Mon Sep 17 00:00:00 2001 | ||
2 | From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Wed, 25 May 2011 01:08:53 +0000 | ||
4 | Subject: [PATCH] PR c++/49042 | ||
5 | * pt.c (get_mostly_instantiated_function_type): Use | ||
6 | push_deferring_access_checks rather than set flag_access_control. | ||
7 | |||
8 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174164 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
9 | |||
10 | index e7040c1..b16d229 100644 | ||
11 | --- a/gcc/cp/pt.c | ||
12 | +++ b/gcc/cp/pt.c | ||
13 | @@ -17800,7 +17800,7 @@ get_mostly_instantiated_function_type (tree decl) | ||
14 | ; | ||
15 | else | ||
16 | { | ||
17 | - int i, save_access_control; | ||
18 | + int i; | ||
19 | tree partial_args; | ||
20 | |||
21 | /* Replace the innermost level of the TARGS with NULL_TREEs to | ||
22 | @@ -17815,8 +17815,7 @@ get_mostly_instantiated_function_type (tree decl) | ||
23 | |||
24 | /* Disable access control as this function is used only during | ||
25 | name-mangling. */ | ||
26 | - save_access_control = flag_access_control; | ||
27 | - flag_access_control = 0; | ||
28 | + push_deferring_access_checks (dk_no_check); | ||
29 | |||
30 | ++processing_template_decl; | ||
31 | /* Now, do the (partial) substitution to figure out the | ||
32 | @@ -17831,7 +17830,7 @@ get_mostly_instantiated_function_type (tree decl) | ||
33 | TREE_VEC_LENGTH (partial_args)--; | ||
34 | tparms = tsubst_template_parms (tparms, partial_args, tf_error); | ||
35 | |||
36 | - flag_access_control = save_access_control; | ||
37 | + pop_deferring_access_checks (); | ||
38 | } | ||
39 | |||
40 | return fn_type; | ||
41 | new file mode 100644 | ||
42 | index 0000000..43e5e86 | ||
43 | --- /dev/null | ||
44 | +++ b/gcc/testsuite/g++.dg/cpp0x/access01.C | ||
45 | @@ -0,0 +1,15 @@ | ||
46 | +// PR c++/49042 | ||
47 | +// { dg-options -std=c++0x } | ||
48 | + | ||
49 | +template <class T> | ||
50 | +class A | ||
51 | +{ | ||
52 | + T p; | ||
53 | +public: | ||
54 | + template <class U> auto f() -> decltype(+p) { } | ||
55 | +}; | ||
56 | + | ||
57 | +int main() | ||
58 | +{ | ||
59 | + A<int>().f<int>(); | ||
60 | +} | ||
61 | -- | ||
62 | 1.7.0.4 | ||
63 | |||