re PR c++/65075 (constexpr regression)

PR c++/65075
	* constexpr.c (check_constexpr_bind_expr_vars): Allow
	implicit typedefs for lambda types.

	* g++.dg/cpp0x/pr65075.C: New test.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r220748
This commit is contained in:
Paolo Carlini 2015-02-17 08:25:30 +00:00 committed by Jakub Jelinek
parent 524d87f3a5
commit 4414e22eee
4 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2015-02-17 Paolo Carlini <paolo.carlini@oracle.com>
Jakub Jelinek <jakub@redhat.com>
PR c++/65075
* constexpr.c (check_constexpr_bind_expr_vars): Allow
implicit typedefs for lambda types.
2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60894

View File

@ -416,7 +416,8 @@ check_constexpr_bind_expr_vars (tree t)
for (tree var = BIND_EXPR_VARS (t); var; var = DECL_CHAIN (var))
if (TREE_CODE (var) == TYPE_DECL
&& DECL_IMPLICIT_TYPEDEF_P (var))
&& DECL_IMPLICIT_TYPEDEF_P (var)
&& !LAMBDA_TYPE_P (TREE_TYPE (var)))
return false;
return true;
}

View File

@ -1,3 +1,9 @@
2015-02-17 Paolo Carlini <paolo.carlini@oracle.com>
Jakub Jelinek <jakub@redhat.com>
PR c++/65075
* g++.dg/cpp0x/pr65075.C: New test.
2015-02-16 David Edelsohn <dje.gcc@gmail.com>
PR target/65058

View File

@ -0,0 +1,17 @@
// PR c++/65075
// { dg-do compile { target c++11 } }
typedef void (*E) ();
template <class T>
constexpr E
bar (bool a)
{
return a ? []() {} : []() {};
}
void
foo ()
{
(bar<int> (false)) ();
(bar<int> (true)) ();
}