*** empty log message ***

From-SVN: r56347
This commit is contained in:
Gabriel Dos Reis 2002-08-15 11:42:51 +00:00 committed by Gabriel Dos Reis
parent eac5ce6c93
commit e8fe46d4d6
3 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2002-08-15 Gabriel Dos Reis <gdr@nerim.net>
Fix PR/7504
* parse.y (parse_finish_call_expr): Handle incomplete
type used to name a scope.
2002-08-15 Nathan Sidwell <nathan@codesourcery.com>
PR c++/7598

View File

@ -4133,7 +4133,13 @@ parse_finish_call_expr (tree fn, tree args, int koenig)
fn = lookup_namespace_name (scope, name);
else
{
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
if (!COMPLETE_TYPE_P (scope) && !TYPE_BEING_DEFINED (scope))
{
error ("incomplete type '%T' cannot be used to name a scope",
scope);
return error_mark_node;
}
else if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
{
template_id = name;
template_args = TREE_OPERAND (name, 1);

View File

@ -0,0 +1,12 @@
// Copyright (C) 2002 Free Software Foundation
// Origin: jmr@fulcrummicro.com
// Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
struct A;
int main()
{
A::g(); // { dg-error "incomplete" "" }
}