This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ Patch/RFC] PR 53184


Hi,

per the audit trail, this issue appears to boil down to two separate issues:
- The warning doesn't appear universally useful, thus it would be nice to give it a name in order to enable disabling it. - As shown by the testcase, sometimes the wording is misleading: it talks about 'anonymous namespace', where, as clarified by Jason in the trail, the issue is really about a type with no linkage, no namespace involved.

- The former is easy done, I picked: -Wsubobject-linkage. Makes sense?
- The latter is a little more tricky, because it doesn't seem always easy to tell one case from the other, in particular when templates are involved (eg, g++.dg/warn/anonymous-namespace-3.C) and the linkage issue involves template arguments. Given that the warning doesn't seem terribly important (as another data point, clang doesn't have it), so far I have conditionals which reliably figure out cases of anonymous namespace and cases of no linkage (per the testcase at issue, for example) and otherwise fall back to an 'or' wording. I hope the improvement is good enough. Alternately, I suppose the warning could use a completely different, more generic, wording, but in that case testcases like anonymous-namespace-3.C will need adjustment.

Tested x86_64-linux.

Thanks,
Paolo.

////////////////////////////

Attachment: patch_53184
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]