Commit 90481257 by Jason Merrill Committed by Jason Merrill

re PR c++/56071 (friend class template cannot access private constructor in…

re PR c++/56071 (friend class template cannot access private constructor in exception-specification)

	PR c++/56071
	* pt.c (maybe_instantiate_noexcept): Don't defer access checks.

From-SVN: r195378
parent fa817f7f
2013-01-22 Jason Merrill <jason@redhat.com>
PR c++/56071
* pt.c (maybe_instantiate_noexcept): Don't defer access checks.
2013-01-22 Dodji Seketeli <dodji@redhat.com> 2013-01-22 Dodji Seketeli <dodji@redhat.com>
PR c++/53609 PR c++/53609
......
...@@ -18429,12 +18429,14 @@ maybe_instantiate_noexcept (tree fn) ...@@ -18429,12 +18429,14 @@ maybe_instantiate_noexcept (tree fn)
if (push_tinst_level (fn)) if (push_tinst_level (fn))
{ {
push_access_scope (fn); push_access_scope (fn);
push_deferring_access_checks (dk_no_deferred);
input_location = DECL_SOURCE_LOCATION (fn); input_location = DECL_SOURCE_LOCATION (fn);
noex = tsubst_copy_and_build (DEFERRED_NOEXCEPT_PATTERN (noex), noex = tsubst_copy_and_build (DEFERRED_NOEXCEPT_PATTERN (noex),
DEFERRED_NOEXCEPT_ARGS (noex), DEFERRED_NOEXCEPT_ARGS (noex),
tf_warning_or_error, fn, tf_warning_or_error, fn,
/*function_p=*/false, /*function_p=*/false,
/*integral_constant_expression_p=*/true); /*integral_constant_expression_p=*/true);
pop_deferring_access_checks ();
pop_access_scope (fn); pop_access_scope (fn);
pop_tinst_level (); pop_tinst_level ();
spec = build_noexcept_spec (noex, tf_warning_or_error); spec = build_noexcept_spec (noex, tf_warning_or_error);
......
// PR c++/56071
// { dg-options -std=c++11 }
class B
{
template <typename T> friend struct A;
B() {}
};
template <typename T>
struct A
{
A() noexcept(noexcept(B())) { }
};
struct C
{
C()
{
static_assert( !noexcept(A<int>()), "" );
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment