Skip to content

Commit 12a71d1

Browse files
peterschrammeltautschnig
authored andcommitted
Do not check friend declarations in wrong scope
1 parent c9094dd commit 12a71d1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/cpp/cpp_declarator_converter.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,18 @@ symbolt &cpp_declarator_convertert::convert(
6969
scope=&cpp_typecheck.cpp_scopes.current_scope();
7070

7171
// check the declarator-part of the type, in that scope
72-
cpp_typecheck.typecheck_type(final_type);
72+
//TODO: if it is a friend declaration we have to type-check it
73+
// in our current scope to have access to the correct
74+
// template parameters, although the symbol finally resides
75+
// in the resolved scope (actually it should be sufficient
76+
// to tag the symbol as friend in the resolved scope, once it is
77+
// type-checked)
78+
if(!is_friend)
79+
cpp_typecheck.typecheck_type(final_type);
7380
}
81+
//TODO: see comment above
82+
if(is_friend)
83+
cpp_typecheck.typecheck_type(final_type);
7484

7585
is_code=is_code_type(final_type);
7686

0 commit comments

Comments
 (0)