re PR c++/56450 (ICE with SFINAE when detecting non-static member variable)

/cp
2013-04-28  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/56450
	* semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.

/testsuite
2013-04-28  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/56450
	* g++.dg/cpp0x/decltype52.C: New.

From-SVN: r198381
This commit is contained in:
Paolo Carlini 2013-04-28 22:56:44 +00:00 committed by Paolo Carlini
parent 01187df097
commit 4882d82a27
4 changed files with 29 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2013-04-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/56450
* semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
2013-04-26 Jakub Jelinek <jakub@redhat.com>
* error.c (cp_print_error_function): Adjust file_name_as_prefix

View File

@ -5398,6 +5398,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p,
break;
case COMPONENT_REF:
case COMPOUND_EXPR:
mark_type_use (expr);
type = is_bitfield_expr_with_lowered_type (expr);
if (!type)

View File

@ -1,3 +1,8 @@
2013-04-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/56450
* g++.dg/cpp0x/decltype52.C: New.
2013-04-28 Jakub Jelinek <jakub@redhat.com>
N3472 binary constants

View File

@ -0,0 +1,18 @@
// PR c++/56450
// { dg-do compile { target c++11 } }
template<typename T>
T&& declval();
template<typename, typename>
struct is_same
{ static constexpr bool value = false; };
template<typename T>
struct is_same<T, T>
{ static constexpr bool value = true; };
struct A { static const int dummy = 0; };
static_assert(is_same<decltype(declval<A>().dummy), const int>::value, "");
static_assert(!is_same<decltype(declval<A>().dummy), const int&>::value, "");