* cp-tree.h (struct deferred_access_check): Add location.
* semantics.c (perform_access_checks): Use it.
(perform_or_defer_access_check): Store it.
From-SVN: r189552
+2012-07-16 Jason Merrill <jason@redhat.com>
+
+ * cp-tree.h (struct deferred_access_check): Add location.
+ * semantics.c (perform_access_checks): Use it.
+ (perform_or_defer_access_check): Store it.
+
2012-07-16 Steven Bosscher <steven@gcc.gnu.org>
* dump.c (dump_stmt): Moved here from c-dump.c.
tree decl;
/* The declaration that should be used in the error message. */
tree diag_decl;
+ /* The location of this access. */
+ location_t loc;
} deferred_access_check;
DEF_VEC_O(deferred_access_check);
DEF_VEC_ALLOC_O(deferred_access_check,gc);
{
int i;
deferred_access_check *chk;
+ location_t loc = input_location;
if (!checks)
return;
FOR_EACH_VEC_ELT (deferred_access_check, checks, i, chk)
- enforce_access (chk->binfo, chk->decl, chk->diag_decl);
+ {
+ input_location = chk->loc;
+ enforce_access (chk->binfo, chk->decl, chk->diag_decl);
+ }
+
+ input_location = loc;
}
/* Perform the deferred access checks.
new_access->binfo = binfo;
new_access->decl = decl;
new_access->diag_decl = diag_decl;
+ new_access->loc = input_location;
}
/* Used by build_over_call in LOOKUP_SPECULATIVE mode: return whether DECL
+2012-07-16 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/parse/access8.C: Adjust.
+ * g++.dg/template/sfinae6_neg.C: Adjust.
+
2012-07-16 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/53824
typedef int memfun; // { dg-error "private" }
};
-template<foo::memfun>
-struct fm_obj { }; // { dg-error "context" }
+template<foo::memfun> // { dg-error "context" }
+struct fm_obj { };
template <typename T = foo::memfun> // { dg-error "context" }
struct S {};
template<typename F, typename T1, typename T2>
typename enable_if<sizeof(create_a<F>()(create_a<T1>(), create_a<T2>()), 1),
yes_type>::type
- check_is_callable2(type<F>, type<T1>, type<T2>);
+ check_is_callable2(type<F>, type<T1>, type<T2>); // { dg-error "within this context" }
no_type check_is_callable2(...);
template<typename F, typename T1, typename T2 = T1>
struct is_callable2
{
- static const bool value = // { dg-error "within this context" }
+ static const bool value =
(sizeof(check_is_callable2(type<F>(), type<T1>(), type<T2>()))
== sizeof(yes_type));
};