Warn that classes defined in the compilation unit scope are not supported
This commit is contained in:
parent
1572dcd3fd
commit
ec2793c9b0
1
parse.y
1
parse.y
|
|
@ -1589,6 +1589,7 @@ package_item /* IEEE1800-2005 A.1.10 */
|
|||
| function_declaration
|
||||
| task_declaration
|
||||
| data_declaration
|
||||
| class_declaration
|
||||
;
|
||||
|
||||
package_item_list
|
||||
|
|
|
|||
11
pform.cc
11
pform.cc
|
|
@ -328,6 +328,17 @@ PClass* pform_push_class_scope(const struct vlltype&loc, perm_string name)
|
|||
|
||||
assert(!pform_cur_generate);
|
||||
|
||||
/* If no scope was found then this is being defined in the
|
||||
* compilation unit scope. */
|
||||
if (scopex == 0) {
|
||||
cerr << class_scope->get_fileline() << ": sorry: class "
|
||||
"declarations in the compilation unit scope are not yet "
|
||||
"supported." << endl;
|
||||
error_count += 1;
|
||||
lexical_scope = class_scope;
|
||||
return class_scope;
|
||||
}
|
||||
|
||||
if (scopex->classes.find(name) != scopex->classes.end()) {
|
||||
cerr << class_scope->get_fileline() << ": error: duplicate "
|
||||
"definition for class '" << name << "' in '"
|
||||
|
|
|
|||
Loading…
Reference in New Issue