summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0348-PR-c-49156.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0348-PR-c-49156.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0348-PR-c-49156.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0348-PR-c-49156.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0348-PR-c-49156.patch
new file mode 100644
index 0000000000..f5a5036c1a
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0348-PR-c-49156.patch
@@ -0,0 +1,62 @@
1From 08582a924888d536bb82007d7768ef67fc1804ac Mon Sep 17 00:00:00 2001
2From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Thu, 26 May 2011 03:06:17 +0000
4Subject: [PATCH] PR c++/49156
5 * error.c (dump_template_bindings): Set processing_template_decl
6 for a partial instantiation.
7
8git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174261 138bc75d-0d04-0410-961f-82ee72b054a4
9
10index 2477123..dffc764 100644
11--- a/gcc/cp/error.c
12+++ b/gcc/cp/error.c
13@@ -306,6 +306,7 @@ dump_template_bindings (tree parms, tree args, VEC(tree,gc)* typenames)
14
15 FOR_EACH_VEC_ELT (tree, typenames, i, t)
16 {
17+ bool dependent = uses_template_parms (args);
18 if (need_comma)
19 pp_separate_with_comma (cxx_pp);
20 dump_type (t, TFF_PLAIN_IDENTIFIER);
21@@ -313,7 +314,11 @@ dump_template_bindings (tree parms, tree args, VEC(tree,gc)* typenames)
22 pp_equal (cxx_pp);
23 pp_cxx_whitespace (cxx_pp);
24 push_deferring_access_checks (dk_no_check);
25+ if (dependent)
26+ ++processing_template_decl;
27 t = tsubst (t, args, tf_none, NULL_TREE);
28+ if (dependent)
29+ --processing_template_decl;
30 pop_deferring_access_checks ();
31 /* Strip typedefs. We can't just use TFF_CHASE_TYPEDEF because
32 pp_simple_type_specifier doesn't know about it. */
33new file mode 100644
34index 0000000..29a1cdd
35--- /dev/null
36+++ b/gcc/testsuite/g++.dg/cpp0x/error4.C
37@@ -0,0 +1,22 @@
38+// PR c++/49156
39+// { dg-options -std=c++0x }
40+
41+template<typename T> T declval();
42+
43+template<typename T>
44+struct S {
45+
46+ template<typename U>
47+ static U get(const volatile T&);
48+
49+ template<typename U>
50+ static decltype(*declval<U>()) get(...);
51+
52+ typedef decltype(get<T>(declval<T>())) type; // { dg-error "no match" }
53+};
54+
55+struct X { };
56+
57+S<X>::type x;
58+
59+// { dg-prune-output "note" }
60--
611.7.0.4
62