+/**
+ * Check if a given declaration represents a variable.
+ */
+static bool is_var_declaration(const declaration_t *declaration) {
+ switch ((storage_class_tag_t) declaration->storage_class) {
+ case STORAGE_CLASS_NONE:
+ case STORAGE_CLASS_EXTERN:
+ case STORAGE_CLASS_STATIC:
+ case STORAGE_CLASS_AUTO:
+ case STORAGE_CLASS_REGISTER:
+ case STORAGE_CLASS_THREAD:
+ case STORAGE_CLASS_THREAD_EXTERN:
+ case STORAGE_CLASS_THREAD_STATIC: {
+ const type_t *type = skip_typeref(declaration->type);
+ if(is_type_function(type)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ default:
+ return false;
+ }
+}
+