diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/parser.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/decltype21.C | 16 |
4 files changed, 28 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 284224f..a0f1f22 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-07-23 Jason Merrill <jason@redhat.com> + + PR c++/49823 + * parser.c (cp_parser_qualifying_entity): Handle templates. + 2011-07-22 Jason Merrill <jason@redhat.com> PR c++/49793 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index dc54dc2..4e7d905 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -4638,7 +4638,9 @@ cp_parser_qualifying_entity (cp_parser *parser, cp_parser_simulate_error (parser); return error_mark_node; } - return TYPE_NAME (scope); + if (TYPE_NAME (scope)) + scope = TYPE_NAME (scope); + return scope; } /* Before we try to parse the class-name, we must save away the diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1d0d089..9eb5de6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-07-23 Jason Merrill <jason@redhat.com> + + * g++.dg/cpp0x/decltype21.C: Add 49823 examples. + 2011-07-22 Jason Merrill <jason@redhat.com> PR c++/49793 diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype21.C b/gcc/testsuite/g++.dg/cpp0x/decltype21.C index ee73bfb..7337256 100644 --- a/gcc/testsuite/g++.dg/cpp0x/decltype21.C +++ b/gcc/testsuite/g++.dg/cpp0x/decltype21.C @@ -10,6 +10,22 @@ struct c : decltype(make<p>()) {}; decltype(make<p>())::t t; +// PR c++/49823 + +template < typename T > +auto f( const T &x ) + -> typename decltype( x )::type; // ICE on here + +template < typename T > +typename decltype( T{} )::type // ICE on here +f( T ); + +template < typename T > +void f( T x ) +{ typename decltype( x )::type t; } // ICE on here + +// Negative tests + int f(); decltype(f())::t t2; // { dg-error "not a class" } |