re PR c++/24560 ("insufficient contextual information to determine type" is not a helpful error message)
PR c++/24560 * parser.c (cp_parser_postfix_dot_deref_expression): Improve error message for use of overloaded functions on LHS of "." operator. PR c++/24560 * g++.dg/parse/dot1.C: New test. From-SVN: r106408
This commit is contained in:
parent
fb530c72ed
commit
e4ba253407
@ -1,5 +1,9 @@
|
||||
2005-11-02 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/24560
|
||||
* parser.c (cp_parser_postfix_dot_deref_expression): Improve error
|
||||
message for use of overloaded functions on LHS of "." operator.
|
||||
|
||||
PR c++/19253
|
||||
* parser.c (cp_parser_postfix_expression): Use
|
||||
cp_parser_elaborated_type_specifier to handle typename-types in
|
||||
|
@ -4363,7 +4363,13 @@ cp_parser_postfix_dot_deref_expression (cp_parser *parser,
|
||||
underlying type here. */
|
||||
scope = non_reference (scope);
|
||||
/* The type of the POSTFIX_EXPRESSION must be complete. */
|
||||
scope = complete_type_or_else (scope, NULL_TREE);
|
||||
if (scope == unknown_type_node)
|
||||
{
|
||||
error ("%qE does not have class type", postfix_expression);
|
||||
scope = NULL_TREE;
|
||||
}
|
||||
else
|
||||
scope = complete_type_or_else (scope, NULL_TREE);
|
||||
/* Let the name lookup machinery know that we are processing a
|
||||
class member access expression. */
|
||||
parser->context->object_type = scope;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2005-11-02 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/24560
|
||||
* g++.dg/parse/dot1.C: New test.
|
||||
|
||||
2005-11-02 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
PR target/23303
|
||||
|
4
gcc/testsuite/g++.dg/parse/dot1.C
Normal file
4
gcc/testsuite/g++.dg/parse/dot1.C
Normal file
@ -0,0 +1,4 @@
|
||||
// PR c++/24560
|
||||
|
||||
struct A { void f(); };
|
||||
void g() { A().f.a; } // { dg-error "class" }
|
Loading…
Reference in New Issue
Block a user