Commit 82e78c3f by Paolo Carlini Committed by Paolo Carlini

re PR c++/63693 (ICE in resolve_typename_type)

/cp
2015-08-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/63693
	* pt.c (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE_TYPE
	only on class types.

/testsuite
2015-08-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/63693
	* g++.dg/cpp0x/decltype63.C: New.

From-SVN: r227098
parent 2e969ce5
2015-08-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/63693
* pt.c (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE_TYPE
only on class types.
2015-08-21 Jason Merrill <jason@redhat.com> 2015-08-21 Jason Merrill <jason@redhat.com>
PR c++/67240 PR c++/67240
......
...@@ -22673,7 +22673,8 @@ resolve_typename_type (tree type, bool only_current_p) ...@@ -22673,7 +22673,8 @@ resolve_typename_type (tree type, bool only_current_p)
return type; return type;
/* If SCOPE isn't the template itself, it will not have a valid /* If SCOPE isn't the template itself, it will not have a valid
TYPE_FIELDS list. */ TYPE_FIELDS list. */
if (same_type_p (scope, CLASSTYPE_PRIMARY_TEMPLATE_TYPE (scope))) if (CLASS_TYPE_P (scope)
&& same_type_p (scope, CLASSTYPE_PRIMARY_TEMPLATE_TYPE (scope)))
/* scope is either the template itself or a compatible instantiation /* scope is either the template itself or a compatible instantiation
like X<T>, so look up the name in the original template. */ like X<T>, so look up the name in the original template. */
scope = CLASSTYPE_PRIMARY_TEMPLATE_TYPE (scope); scope = CLASSTYPE_PRIMARY_TEMPLATE_TYPE (scope);
......
2015-08-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/63693
* g++.dg/cpp0x/decltype63.C: New.
2015-08-22 Nathan Sidwell <nathan@acm.org> 2015-08-22 Nathan Sidwell <nathan@acm.org>
* c-c++-common/Wsizeof-pointer-memaccess1.c: Require alloca. * c-c++-common/Wsizeof-pointer-memaccess1.c: Require alloca.
......
// PR c++/63693
// { dg-do compile { target c++11 } }
template<typename T>
class C{
T t;
decltype(t)::a:: // { dg-error "expected" }
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