Commit 5a8c97d8 by Jason Merrill Committed by Jason Merrill

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
parent f298ca26
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
......
......@@ -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;
......
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.
......
// PR c++/50365
// { dg-options -std=c++0x }
struct A { int i; };
struct B {
B();
A* f();
};
B::B()
{
int(f()->i);
}
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