Skip to content

Commit

Permalink
/cp
Browse files Browse the repository at this point in the history
2018-04-18  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84630
	* pt.c (tsubst_lambda_expr): Check begin_lambda_type return value
	for error_mark_node.

/testsuite
2018-04-18  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84630
	* g++.dg/cpp0x/pr84630.C: New.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@259460 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
paolo committed Apr 18, 2018
1 parent f57e456 commit dc20975
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gcc/cp/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2018-04-18 Paolo Carlini <paolo.carlini@oracle.com>

PR c++/84630
* pt.c (tsubst_lambda_expr): Check begin_lambda_type return value
for error_mark_node.

2018-04-18 Jakub Jelinek <jakub@redhat.com>

PR c++/84463
Expand Down
2 changes: 2 additions & 0 deletions gcc/cp/pt.c
Original file line number Diff line number Diff line change
Expand Up @@ -17570,6 +17570,8 @@ tsubst_lambda_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
}

tree type = begin_lambda_type (r);
if (type == error_mark_node)
return error_mark_node;

/* Do this again now that LAMBDA_EXPR_EXTRA_SCOPE is set. */
determine_visibility (TYPE_NAME (type));
Expand Down
5 changes: 5 additions & 0 deletions gcc/testsuite/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2018-04-18 Paolo Carlini <paolo.carlini@oracle.com>

PR c++/84630
* g++.dg/cpp0x/pr84630.C: New.

2018-04-18 Jakub Jelinek <jakub@redhat.com>

PR c++/84463
Expand Down
7 changes: 7 additions & 0 deletions gcc/testsuite/g++.dg/cpp0x/pr84630.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// PR c++/84630
// { dg-do compile { target c++11 } }

template <typename...> struct c {
template <int> __attribute__((noinline([] {}))) int b(); // { dg-error "wrong number of arguments" }
};
c<> a;

0 comments on commit dc20975

Please sign in to comment.