re PR c++/54359 ([C++0x] decltype in member function's trailing return type when defined outside of class)
PR c++/54359 PR c++/56639 * parser.c (cp_parser_direct_declarator): Bail if we see a qualified-id not at namespace scope. From-SVN: r196765
This commit is contained in:
parent
d0d475ef30
commit
136357ac8d
|
@ -1,5 +1,10 @@
|
||||||
2013-03-17 Jason Merrill <jason@redhat.com>
|
2013-03-17 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/54359
|
||||||
|
PR c++/56639
|
||||||
|
* parser.c (cp_parser_direct_declarator): Bail if we see a
|
||||||
|
qualified-id not at namespace scope.
|
||||||
|
|
||||||
PR c++/17232
|
PR c++/17232
|
||||||
PR c++/56642
|
PR c++/56642
|
||||||
* typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
|
* typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
|
||||||
|
|
|
@ -16707,9 +16707,18 @@ cp_parser_direct_declarator (cp_parser* parser,
|
||||||
handle_declarator:;
|
handle_declarator:;
|
||||||
scope = get_scope_of_declarator (declarator);
|
scope = get_scope_of_declarator (declarator);
|
||||||
if (scope)
|
if (scope)
|
||||||
/* Any names that appear after the declarator-id for a
|
{
|
||||||
member are looked up in the containing scope. */
|
/* Any names that appear after the declarator-id for a
|
||||||
pushed_scope = push_scope (scope);
|
member are looked up in the containing scope. */
|
||||||
|
if (at_function_scope_p ())
|
||||||
|
{
|
||||||
|
/* But declarations with qualified-ids can't appear in a
|
||||||
|
function. */
|
||||||
|
cp_parser_error (parser, "qualified-id in declaration");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
pushed_scope = push_scope (scope);
|
||||||
|
}
|
||||||
parser->in_declarator_p = true;
|
parser->in_declarator_p = true;
|
||||||
if ((ctor_dtor_or_conv_p && *ctor_dtor_or_conv_p)
|
if ((ctor_dtor_or_conv_p && *ctor_dtor_or_conv_p)
|
||||||
|| (declarator && declarator->kind == cdk_id))
|
|| (declarator && declarator->kind == cdk_id))
|
||||||
|
|
|
@ -22,7 +22,7 @@ struct B
|
||||||
A().bar<typename T>(t); } // { dg-error "expected|parse error|no matching" }
|
A().bar<typename T>(t); } // { dg-error "expected|parse error|no matching" }
|
||||||
// { dg-message "candidate" "candidate note" { target *-*-* } 22 }
|
// { dg-message "candidate" "candidate note" { target *-*-* } 22 }
|
||||||
void bad(T t) {
|
void bad(T t) {
|
||||||
B<typename T>::bar(t); } // { dg-error "invalid|not a template" }
|
B<typename T>::bar(t); } // { dg-error "invalid|qualified-id|not a template" }
|
||||||
};
|
};
|
||||||
|
|
||||||
void baz()
|
void baz()
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
// PR c++/56639
|
||||||
|
|
||||||
|
struct A {
|
||||||
|
int i;
|
||||||
|
static A* f();
|
||||||
|
};
|
||||||
|
|
||||||
|
struct B {
|
||||||
|
void g() {
|
||||||
|
int (A::f()->i);
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue