PR c++/47336
* error.c (dump_template_bindings): Suppress access control.
From-SVN: r174072
2011-05-23 Jason Merrill <jason@redhat.com>
+ PR c++/47336
+ * error.c (dump_template_bindings): Suppress access control.
+
PR c++/47544
* pt.c (instantiate_decl): Handle =default.
pp_cxx_whitespace (cxx_pp);
pp_equal (cxx_pp);
pp_cxx_whitespace (cxx_pp);
+ push_deferring_access_checks (dk_no_check);
t = tsubst (t, args, tf_none, NULL_TREE);
+ pop_deferring_access_checks ();
/* Strip typedefs. We can't just use TFF_CHASE_TYPEDEF because
pp_simple_type_specifier doesn't know about it. */
t = strip_typedefs (t);
2011-05-23 Jason Merrill <jason@redhat.com>
+ * g++.dg/cpp0x/error3.C: New.
+
* g++.dg/cpp0x/defaulted27.C: New.
* g++.dg/cpp0x/decltype27.C: New.
--- /dev/null
+// PR c++/47336
+// { dg-options -std=c++0x }
+
+template <typename T>
+void g(T t)
+{
+ t+1; // { dg-error "no match" }
+}
+
+template <typename S>
+class C
+{
+ struct D {} d;
+public:
+ decltype(g(d)) h()
+ {
+ return g(d);
+ }
+};
+
+int main()
+{
+ C<int>().h();
+}