Skip to content

Commit

Permalink
smart pointer restrictions are in place
Browse files Browse the repository at this point in the history
  • Loading branch information
borisbat committed Dec 12, 2024
1 parent be667e9 commit 68396bf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ast/ast_typedecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,14 @@ namespace das
return nullptr;
}
// auto? can't be inferred from non-pointer
if ( autoT->isPointer() && (!initT->isPointer() || !initT->firstType) )
return nullptr;
if ( autoT->isPointer() ) {
if ( !initT->isPointer() || !initT->firstType ) {
return nullptr;
}
if ( autoT->smartPtr != initT->smartPtr ) {
return nullptr;
}
}
// array has to match array
if ( autoT->baseType==Type::tArray && (initT->baseType!=Type::tArray || !initT->firstType) )
return nullptr;
Expand Down

0 comments on commit 68396bf

Please sign in to comment.