From: Paolo Carlini Date: Sat, 22 Aug 2015 17:44:46 +0000 (+0000) Subject: re PR c++/63693 (ICE in resolve_typename_type) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=82e78c3f286b8f03008fb22229310cfe4174b1ca;p=gcc.git re PR c++/63693 (ICE in resolve_typename_type) /cp 2015-08-22 Paolo Carlini PR c++/63693 * pt.c (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE_TYPE only on class types. /testsuite 2015-08-22 Paolo Carlini PR c++/63693 * g++.dg/cpp0x/decltype63.C: New. From-SVN: r227098 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c2a1206c66d..b5a3398c8dc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-08-22 Paolo Carlini + + PR c++/63693 + * pt.c (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE_TYPE + only on class types. + 2015-08-21 Jason Merrill PR c++/67240 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index eaafaeff569..fb7b9d21056 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -22673,7 +22673,8 @@ resolve_typename_type (tree type, bool only_current_p) return type; /* If SCOPE isn't the template itself, it will not have a valid 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 like X, so look up the name in the original template. */ scope = CLASSTYPE_PRIMARY_TEMPLATE_TYPE (scope); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index da245386899..aad7edceca4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-08-22 Paolo Carlini + + PR c++/63693 + * g++.dg/cpp0x/decltype63.C: New. + 2015-08-22 Nathan Sidwell * c-c++-common/Wsizeof-pointer-memaccess1.c: Require alloca. diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype63.C b/gcc/testsuite/g++.dg/cpp0x/decltype63.C new file mode 100644 index 00000000000..60dfec47a41 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype63.C @@ -0,0 +1,7 @@ +// PR c++/63693 +// { dg-do compile { target c++11 } } + +template +class C{ + T t; + decltype(t)::a:: // { dg-error "expected" }