@@ -217,15 +217,15 @@ cp_lookup_bare_symbol (const struct language_defn *langdef,
217217 lang_this = lookup_language_this (langdef , block );
218218
219219 if (lang_this .symbol == NULL )
220- return null_block_symbol ;
220+ return {} ;
221221
222222
223223 type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (lang_this .symbol )));
224224 /* If TYPE_NAME is NULL, abandon trying to find this symbol.
225225 This can happen for lambda functions compiled with clang++,
226226 which outputs no name for the container class. */
227227 if (TYPE_NAME (type ) == NULL )
228- return null_block_symbol ;
228+ return {} ;
229229
230230 /* Look for symbol NAME in this class. */
231231 sym = cp_lookup_nested_symbol (type , name , block , domain );
@@ -252,7 +252,7 @@ cp_search_static_and_baseclasses (const char *name,
252252{
253253 /* Check for malformed input. */
254254 if (prefix_len + 2 > strlen (name ) || name [prefix_len + 1 ] != ':' )
255- return null_block_symbol ;
255+ return {} ;
256256
257257 /* The class, namespace or function name is everything up to and
258258 including PREFIX_LEN. */
@@ -272,7 +272,7 @@ cp_search_static_and_baseclasses (const char *name,
272272 if (scope_sym .symbol == NULL )
273273 scope_sym = lookup_global_symbol (scope .c_str (), block , VAR_DOMAIN );
274274 if (scope_sym .symbol == NULL )
275- return null_block_symbol ;
275+ return {} ;
276276
277277 struct type * scope_type = SYMBOL_TYPE (scope_sym .symbol );
278278
@@ -379,13 +379,10 @@ cp_lookup_symbol_via_imports (const char *scope,
379379 const int search_parents )
380380{
381381 struct using_direct * current ;
382- struct block_symbol sym ;
382+ struct block_symbol sym = {} ;
383383 int len ;
384384 int directive_match ;
385385
386- sym .symbol = NULL ;
387- sym .block = NULL ;
388-
389386 /* First, try to find the symbol in the given namespace if requested. */
390387 if (search_scope_first )
391388 sym = cp_lookup_symbol_in_namespace (scope , name ,
@@ -476,7 +473,7 @@ cp_lookup_symbol_via_imports (const char *scope,
476473 }
477474 }
478475
479- return null_block_symbol ;
476+ return {} ;
480477}
481478
482479/* Helper function that searches an array of symbols for one named NAME. */
@@ -621,7 +618,7 @@ cp_lookup_symbol_via_all_imports (const char *scope, const char *name,
621618 block = BLOCK_SUPERBLOCK (block );
622619 }
623620
624- return null_block_symbol ;
621+ return {} ;
625622}
626623
627624/* Searches for NAME in the current namespace, and by applying
@@ -808,10 +805,7 @@ find_symbol_in_baseclass (struct type *parent_type, const char *name,
808805 int is_in_anonymous )
809806{
810807 int i ;
811- struct block_symbol sym ;
812-
813- sym .symbol = NULL ;
814- sym .block = NULL ;
808+ struct block_symbol sym = {};
815809
816810 for (i = 0 ; i < TYPE_N_BASECLASSES (parent_type ); ++ i )
817811 {
@@ -902,7 +896,7 @@ cp_lookup_nested_symbol_1 (struct type *container_type,
902896 return sym ;
903897 }
904898
905- return null_block_symbol ;
899+ return {} ;
906900}
907901
908902/* Look up a symbol named NESTED_NAME that is nested inside the C++
@@ -979,7 +973,7 @@ cp_lookup_nested_symbol (struct type *parent_type,
979973 "cp_lookup_nested_symbol (...) = NULL"
980974 " (func/method)\n" );
981975 }
982- return null_block_symbol ;
976+ return {} ;
983977
984978 default :
985979 internal_error (__FILE__ , __LINE__ ,
0 commit comments