Generate an error for variables declared with type void
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 23 Mar 2010 19:28:44 +0000 (12:28 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 23 Mar 2010 19:28:44 +0000 (12:28 -0700)
ast_to_hir.cpp

index feeb0d925dd5fead431f9d19199be0f8c047774b..62f2068b3a22f39b5085f704dd2cc572e09a0577 100644 (file)
@@ -841,7 +841,7 @@ ast_declarator_list::hir(exec_list *instructions,
        * FINISHME: declaration at a higher scope.
        */
 
-      if (decl_type == NULL) {
+      if ((decl_type == NULL) || decl_type->is_void()) {
         YYLTYPE loc;
 
         loc = this->get_location();