Commit 447306fa by Nathan Sidwell Committed by Nathan Sidwell

lex.c (rid_to_yy, RID_EXPORT): Make unique keyword.

cp:
	* lex.c (rid_to_yy, RID_EXPORT): Make unique keyword.
	* parse.y (extdef): Add EXPORT reduction.
	* spew.c (yylex): Don't skip export here.
testsuite:
	* g++.old-deja/g++.pt/export1.C: New test.

From-SVN: r37585
parent 462ef1e1
2000-11-20 Nathan Sidwell <nathan@codesourcery.com>
* lex.c (rid_to_yy, RID_EXPORT): Make unique keyword.
* parse.y (extdef): Add EXPORT reduction.
* spew.c (yylex): Don't skip export here.
2000-11-19 Mark Mitchell <mark@codesourcery.com> 2000-11-19 Mark Mitchell <mark@codesourcery.com>
* decl.c (init_decl_processing): Correct name of pure virtual * decl.c (init_decl_processing): Correct name of pure virtual
......
...@@ -544,7 +544,7 @@ const short rid_to_yy[RID_MAX] = ...@@ -544,7 +544,7 @@ const short rid_to_yy[RID_MAX] =
/* RID_FRIEND */ SCSPEC, /* RID_FRIEND */ SCSPEC,
/* RID_VIRTUAL */ SCSPEC, /* RID_VIRTUAL */ SCSPEC,
/* RID_EXPLICIT */ SCSPEC, /* RID_EXPLICIT */ SCSPEC,
/* RID_EXPORT */ SCSPEC, /* RID_EXPORT */ EXPORT,
/* RID_MUTABLE */ SCSPEC, /* RID_MUTABLE */ SCSPEC,
/* ObjC */ /* ObjC */
......
...@@ -278,7 +278,7 @@ cp_parse_init () ...@@ -278,7 +278,7 @@ cp_parse_init ()
%token NAMESPACE TYPENAME_KEYWORD USING %token NAMESPACE TYPENAME_KEYWORD USING
%token LEFT_RIGHT TEMPLATE %token LEFT_RIGHT TEMPLATE
%token TYPEID DYNAMIC_CAST STATIC_CAST REINTERPRET_CAST CONST_CAST %token TYPEID DYNAMIC_CAST STATIC_CAST REINTERPRET_CAST CONST_CAST
%token SCOPE %token SCOPE EXPORT
/* Define the operator tokens and their precedences. /* Define the operator tokens and their precedences.
The value is an integer because, if used, it is the tree code The value is an integer because, if used, it is the tree code
...@@ -485,6 +485,11 @@ extdef: ...@@ -485,6 +485,11 @@ extdef:
{ do_pending_inlines (); } { do_pending_inlines (); }
| datadef | datadef
{ do_pending_inlines (); } { do_pending_inlines (); }
| EXPORT
{ cp_warning ("keyword `export' not implemented, and will be ignored"); }
template_def
{ do_pending_inlines (); }
| template_def | template_def
{ do_pending_inlines (); } { do_pending_inlines (); }
| asm_keyword '(' string ')' ';' | asm_keyword '(' string ')' ';'
......
...@@ -803,17 +803,6 @@ yylex () ...@@ -803,17 +803,6 @@ yylex ()
consume_token (); consume_token ();
} }
} }
/* If export, warn that it's unimplemented and go on. */
else if (nth_token (0)->yylval.ttype == ridpointers[RID_EXPORT])
{
warning ("keyword 'export' not implemented and will be ignored");
#ifdef SPEW_DEBUG
if (spew_debug)
debug_yychar (yychr);
#endif
consume_token ();
goto retry;
}
/* do_aggr needs to know if the previous token was `friend'. */ /* do_aggr needs to know if the previous token was `friend'. */
else if (nth_token (0)->yylval.ttype == ridpointers[RID_FRIEND]) else if (nth_token (0)->yylval.ttype == ridpointers[RID_FRIEND])
after_friend = 1; after_friend = 1;
......
2000-11-20 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.pt/export1.C: New test.
2000-11-20 Jakub Jelinek <jakub@redhat.com> 2000-11-20 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/20001117-1.c: New test. * gcc.dg/20001117-1.c: New test.
......
// Build don't link:
// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 17 Nov 2000 <nathan@codesourcery.com>
// bug 721, we died horribly when export was used wrongly
struct test {
int export(void); // ERROR - parse error
};
int test::export(void) // ERROR - parse error
{
return 0;
}
template <class T> class Y;
export template <class T> class X; // WARNING - export not implemented
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