mrdocs icon indicating copy to clipboard operation
mrdocs copied to clipboard

Many unhandled cases for friend declarations

Open sdkrystian opened this issue 2 years ago • 1 comments

Currently, friend declarations are correctly extracted in only the simplest of cases; any deviation results in asserts firing or incorrect extraction.

sdkrystian avatar Jun 17 '23 19:06 sdkrystian

One way to fix friend declarations: add InfoKind::Friend, and generate the USR for the friend by concatenating the USR of its DeclContext with that of the befriended declaration. Friends could then be stored in RecordInfo::Members (preserving declaration order). This also lets us handle friend declarations which name a declaration for which there is no SymbolID (e.g. friend int; or friend T; where T is a template parameter). Such an implementation additionally allows for hidden friends to be handled correctly.

sdkrystian avatar Jun 17 '23 19:06 sdkrystian