Skip to main content

reference_uses_c_semantics

Function reference_uses_c_semantics 

Source
pub fn reference_uses_c_semantics(
    cpp: &dyn CppSource,
    file: &ProjectFile,
) -> bool
Expand description

Whether a reference written in file reads C++ source with C semantics.

is_c_source_file answers the half a path settles on its own. The other half is a header, which has no dialect of its own: it is read as C exactly when every workspace translation unit that provably compiles it compiles it as C (CppSource::header_uses_c_semantics, issue #1970).

This is the gate for anything that is really about the compilation language of the code being read – which reading of an included header’s declarations is in scope, whether this is an ordinary identifier. It is NOT the gate for a question that is genuinely about a .c file on disk; those keep calling is_c_source_file.