The attached patch adds a getLanguageLinkage method that explicit models the possible language linkages (C, C++, none). This fixes some cases we were producing wrong answers when a function or variable has no language linkage. In particular, with this patch we don't warn anymore in
extern "C" {
static NonPod foo();
}
Checking the linkage when computing the language linkage introduces
two small chalenges:
* We cannot check the language linkage when computing the linkage.
This was done to decide if we should produce uniqueExternal or not,
and I think just checking the decl context has the desired result.
* We cannot ask for the linkage of a decl before linking it in, which
makes the check for conflicting language linkages a bit asymmetrical.
This exposes that we are not currently including the language linkage
in the function type. I added a test with a fixme.
In a followup patch I intend to remove the old isExternC and rename
the current hasCLanguageLinkage to isExternC.
Cheers,
Rafael
t.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
