aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-09-15 10:33:37 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-09-15 10:33:37 -0400
commit5a8c97d80213bed41128b450c3bb174c905459e3 (patch)
tree9009a818f10884a75ee9cd4cdf5f989b09649244 /gcc
parentf298ca2696ac1db770edd7ebdbb641881d82c4e1 (diff)
downloadgcc-5a8c97d80213bed41128b450c3bb174c905459e3.zip
gcc-5a8c97d80213bed41128b450c3bb174c905459e3.tar.gz
gcc-5a8c97d80213bed41128b450c3bb174c905459e3.tar.bz2
re PR c++/50365 (non-static data member error on valid code)
PR c++/50365 * parser.c (cp_parser_late_return_type_opt): Check quals parameter for clearing current_class_ptr, too. From-SVN: r178883
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/trailing7.C14
4 files changed, 24 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index be4f63b..c52dcd7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/50365
+ * parser.c (cp_parser_late_return_type_opt): Check quals parameter
+ for clearing current_class_ptr, too.
+
2011-09-14 Diego Novillo <dnovillo@google.com>
* name-lookup.c (lookup_arg_dependent): Use conditional
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 03f75fc..2283312 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -15721,7 +15721,7 @@ cp_parser_late_return_type_opt (cp_parser* parser, cp_cv_quals quals)
type = cp_parser_trailing_type_id (parser);
- if (current_class_type)
+ if (quals >= 0)
current_class_ptr = current_class_ref = NULL_TREE;
return type;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0bf6170..86cdde0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2011-09-15 Jason Merrill <jason@redhat.com>
+ PR c++/50365
+ * g++.dg/cpp0x/trailing7.C: New.
+
PR c++/50361
* g++.dg/cpp0x/nullptr23.C: New.
diff --git a/gcc/testsuite/g++.dg/cpp0x/trailing7.C b/gcc/testsuite/g++.dg/cpp0x/trailing7.C
new file mode 100644
index 0000000..c4db10e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/trailing7.C
@@ -0,0 +1,14 @@
+// PR c++/50365
+// { dg-options -std=c++0x }
+
+struct A { int i; };
+
+struct B {
+ B();
+ A* f();
+};
+
+B::B()
+{
+ int(f()->i);
+}