File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -491,6 +491,10 @@ void Binder::bind(UsingDirectiveAST* ast) {
491491 }
492492}
493493
494+ void Binder::bind (TypeIdAST* ast, const Decl& decl) {
495+ ast->type = getDeclaratorType (unit_, ast->declarator , decl.specs .getType ());
496+ }
497+
494498auto Binder::declareTypedef (DeclaratorAST* declarator, const Decl& decl)
495499 -> TypeAliasSymbol* {
496500 auto name = decl.getName ();
Original file line number Diff line number Diff line change @@ -123,6 +123,8 @@ class Binder {
123123
124124 void bind (UsingDirectiveAST* ast);
125125
126+ void bind (TypeIdAST* ast, const Decl& decl);
127+
126128 [[nodiscard]] auto instantiate (SimpleTemplateIdAST* templateId) -> Symbol*;
127129
128130 [[nodiscard]] auto resolve (NestedNameSpecifierAST* nestedNameSpecifier,
Original file line number Diff line number Diff line change @@ -5698,8 +5698,7 @@ auto Parser::parse_type_id(TypeIdAST*& yyast) -> bool {
56985698 Decl decl{specs};
56995699 parse_optional_abstract_declarator (yyast->declarator , decl);
57005700
5701- yyast->type =
5702- getDeclaratorType (unit, yyast->declarator , decl.specs .getType ());
5701+ binder_.bind (yyast, decl);
57035702
57045703 return true ;
57055704}
@@ -5726,7 +5725,8 @@ auto Parser::parse_defining_type_id(
57265725
57275726 ast->typeSpecifierList = typeSpecifierList;
57285727 ast->declarator = declarator;
5729- ast->type = getDeclaratorType (unit, ast->declarator , decl.specs .getType ());
5728+
5729+ binder_.bind (ast, decl);
57305730
57315731 return true ;
57325732}
@@ -7935,7 +7935,10 @@ auto Parser::parse_conversion_function_id(ConversionFunctionIdAST*& yyast)
79357935 auto typeId = make_node<TypeIdAST>(pool_);
79367936 typeId->typeSpecifierList = typeSpecifierList;
79377937 typeId->declarator = declarator;
7938- typeId->type = getDeclaratorType (unit, declarator, specs.getType ());
7938+
7939+ Decl decl{specs};
7940+
7941+ binder_.bind (typeId, decl);
79397942
79407943 auto ast = make_node<ConversionFunctionIdAST>(pool_);
79417944 yyast = ast;
You can’t perform that action at this time.
0 commit comments