Merge pull request #673 from larsclausen/package-no-implicit-var
Require explicit data type for package variable declarations
This commit is contained in:
commit
7c5694e516
|
|
@ -0,0 +1,6 @@
|
|||
// Check that it is not possible to declare a variable in a package without an explicit data
|
||||
// type for the variable.
|
||||
|
||||
pacakge P;
|
||||
x; // This is a syntax error
|
||||
endpackage
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
// Check that it is not possible to declare a variable in a package without an explicit data
|
||||
// type for the variable.
|
||||
|
||||
pacakge P;
|
||||
[3:0] x; // This is a syntax error
|
||||
endpackage
|
||||
|
|
@ -536,6 +536,8 @@ sv_package2 normal,-g2009 ivltests
|
|||
sv_package3 normal,-g2009 ivltests
|
||||
sv_package4 normal,-g2009 ivltests
|
||||
sv_package5 normal,-g2009 ivltests
|
||||
sv_package_implicit_var1 CE,-g2009 ivltests
|
||||
sv_package_implicit_var2 CE,-g2009 ivltests
|
||||
sv_packed_port1 normal,-g2009 ivltests
|
||||
sv_packed_port2 normal,-g2009 ivltests
|
||||
sv_param_port_list normal,-g2009 ivltests
|
||||
|
|
|
|||
2
parse.y
2
parse.y
|
|
@ -1161,7 +1161,7 @@ constraint_set /* IEEE1800-2005 A.1.9 */
|
|||
;
|
||||
|
||||
data_declaration /* IEEE1800-2005: A.2.1.3 */
|
||||
: attribute_list_opt data_type_or_implicit list_of_variable_decl_assignments ';'
|
||||
: attribute_list_opt data_type list_of_variable_decl_assignments ';'
|
||||
{ data_type_t*data_type = $2;
|
||||
if (data_type == 0) {
|
||||
data_type = new vector_type_t(IVL_VT_LOGIC, false, 0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue