diff options
author | Jason Merrill <jason@redhat.com> | 2013-04-24 12:46:53 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-04-24 12:46:53 -0400 |
commit | afbce7b7cfb6dcfdebd6ee299557226bd1640a8b (patch) | |
tree | cd0b277add1c56e3597aaaf30e0c33f3368d771b /gcc | |
parent | 44d90fe1c00fa4bf947716cbfecf945892f182a6 (diff) | |
download | gcc-afbce7b7cfb6dcfdebd6ee299557226bd1640a8b.zip gcc-afbce7b7cfb6dcfdebd6ee299557226bd1640a8b.tar.gz gcc-afbce7b7cfb6dcfdebd6ee299557226bd1640a8b.tar.bz2 |
re PR c++/53721 ([C++11] "this" not allowed in trailing return type)
PR c++/53721
* parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
From-SVN: r198257
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/parser.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/decltype51.C | 10 |
3 files changed, 16 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 761ca34..770f24a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2013-04-24 Jason Merrill <jason@redhat.com> + + PR c++/53721 + * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko. + 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com> * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index cb26292..2239a07 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -6155,7 +6155,7 @@ cp_parser_postfix_dot_deref_expression (cp_parser *parser, /* Unlike the object expression in other contexts, *this is not required to be of complete type for purposes of class member access (5.2.5) outside the member function body. */ - else if (scope != current_class_ref + else if (postfix_expression != current_class_ref && !(processing_template_decl && scope == current_class_type)) scope = complete_type_or_else (scope, NULL_TREE); /* Let the name lookup machinery know that we are processing a diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype51.C b/gcc/testsuite/g++.dg/cpp0x/decltype51.C new file mode 100644 index 0000000..9ab41467 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype51.C @@ -0,0 +1,10 @@ +// PR c++/53721 +// { dg-require-effective-target c++11 } + +struct A +{ + void f() {}; + auto g() -> decltype(this->f()) + { + } +}; |