I wrote a small program (see attachement) to exhibit a TNaming bug in OCC 6.5.2. Consider the following: build 3 boxes, fuse them and select (with TNaming_Selector) all result's faces. Call TNaming_Selector::Solve to update the selection and inspect the result (selected faces). The problem is that the TNaming_Selector::NamedShape returns, after calling TNaming_Selector::Solve, a shape of type TopAbs_COMPOUND although the selected shape is of type TopAbs_FACE.
The attached program ilustrates the bug. In order to run it, the user must provide a valid handle TDocStd_Document (see the beginning of function BOP_NamingTest).
Maybe someone can figure out what's happening.