fix cp_error037, fix noconst.c
authorMatthias Braun <matze@braunis.de>
Fri, 1 Aug 2008 08:51:29 +0000 (08:51 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 1 Aug 2008 08:51:29 +0000 (08:51 +0000)
[r20882]

ast.c
ast2firm.c

diff --git a/ast.c b/ast.c
index 7869a05..a191992 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1504,13 +1504,14 @@ bool is_address_constant(const expression_t *expression)
                return is_object_with_linker_constant_address(expression->unary.value);
 
        case EXPR_UNARY_DEREFERENCE: {
-               type_t *real_type = revert_automatic_type_conversion(expression->unary.value);
+               type_t *real_type
+                       = revert_automatic_type_conversion(expression->unary.value);
                /* dereferencing a function is a NOP */
                if(is_type_function(real_type)) {
                        return is_address_constant(expression->unary.value);
                }
 
-               return false;
+               /* fallthrough */
        }
 
        case EXPR_UNARY_CAST:
index 35ceade..509f302 100644 (file)
@@ -997,13 +997,13 @@ static ir_entity *get_function_entity(declaration_t *declaration)
        dbg_info *const dbgi = get_dbg_info(&declaration->source_position);
        entity               = new_d_entity(global_type, id, ir_type_method, dbgi);
        set_entity_ld_ident(entity, create_ld_ident(entity, declaration));
-       if (declaration->storage_class == STORAGE_CLASS_STATIC &&
-               declaration->init.statement == NULL) {
-               /* this entity was declared, but never defined */
-               set_entity_peculiarity(entity, peculiarity_description);
-       }
+
        if (declaration->storage_class == STORAGE_CLASS_STATIC
                        || declaration->is_inline) {
+               if (declaration->init.statement == NULL) {
+                       /* this entity was declared, but is defined nowhere */
+                       set_entity_peculiarity(entity, peculiarity_description);
+               }
                set_entity_visibility(entity, visibility_local);
        } else if (declaration->init.statement != NULL) {
                set_entity_visibility(entity, visibility_external_visible);