[Bug c++/17729] [4.4/4.5/4.6/4.7 Regression] Duplicate __attribute__((deprecated)) warning
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17729 Iain Sandoe iains at gcc dot gnu.org changed: What|Removed |Added Attachment #26539|0 |1 is obsolete|| --- Comment #25 from Iain Sandoe iains at gcc dot gnu.org 2012-02-02 10:51:32 UTC --- Created attachment 26550 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=26550 fix that covers pr50308 as well. The problem I perceive is that we have a set of tests for deprecation sprinkled over the code. This means that each time we uncover a new pathway - e.g. pr50308 there is (potentially) some amendment required. What I can't see (because I don't know the c++ FE well enough) is whether there is a single place that a [possibly more sophisticated] test could be made. For example, since the deprecation state of items does not alter the outcome of parsing, but only the presence of warning/error, perhaps when one logically reaches the ; that would be a place to check the preceding statement for deprecated items? Anyway, the attached patch deals with the fact that we can't check a function ID for deprecation because it might be later overloaded - but also, that we can't delegate all of the checking to the call processing - because function ids might be used without a call.
[Bug c++/17729] [4.4/4.5/4.6/4.7 Regression] Duplicate __attribute__((deprecated)) warning
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17729 Iain Sandoe iains at gcc dot gnu.org changed: What|Removed |Added Attachment #20407|0 |1 is obsolete|| --- Comment #24 from Iain Sandoe iains at gcc dot gnu.org 2012-02-01 10:18:58 UTC --- Created attachment 26539 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=26539 rebased patch This rebased to r183760. Hm. What pr50308 shows is that it's not just about eliminating a duplicate messages, but also about where the test is done. I.E. late enough in the proceedings that overloading and ADL are accounted. Perhaps this patch could be re-considered on that basis (IIUC, Jason's proposed amendment was to replace this change with a hash table recording the fact that we had already emitted a warning and thus suppressing subsequent ones) [see the thread referred above for details]. Clearly just recording the fact we've emitted a warning doesn't help if that warning should not have been emitted in the first place. This patch does NOT fix PR50308 (so, there is either another problem or we are still not making the test in the right place). The patch still fixes the current PR (17729). It might be that it can be amended to deal with PR50308 as well - don't have any time available right now to look. Otherwise, I don't think I know the c++ FE well enough to suggest a better place to put the test.
[Bug c++/17729] [4.4/4.5/4.6/4.7 Regression] Duplicate __attribute__((deprecated)) warning
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17729 --- Comment #23 from Andrew Pinski pinskia at gcc dot gnu.org 2012-02-01 03:17:08 UTC --- Iain, I bet your patch will fix PR 50308. The issue seems similar in that one of them is emitting while doing namelookup and then it is pruned from the overload set. And if it does then that would be a good testcase.
[Bug c++/17729] [4.4/4.5/4.6/4.7 Regression] Duplicate __attribute__((deprecated)) warning
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17729 Paolo Carlini paolo.carlini at oracle dot com changed: What|Removed |Added CC|gcc-bugs at gcc dot gnu.org | --- Comment #19 from Paolo Carlini paolo.carlini at oracle dot com 2012-01-23 13:40:31 UTC --- Hi Iain, I'm not 100% sure to understand: did your patch in Comment #16 pass the testsuite? Did you get around to submit it?
[Bug c++/17729] [4.4/4.5/4.6/4.7 Regression] Duplicate __attribute__((deprecated)) warning
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17729 --- Comment #20 from Iain Sandoe iains at gcc dot gnu.org 2012-01-23 14:08:21 UTC --- (In reply to comment #19) Hi Iain, I'm not 100% sure to understand: did your patch in Comment #16 pass the testsuite? Did you get around to submit it? The problem I was referring to is in making the test-suite harness detect the presence of duplicate messages - and thus to making a test-case to prove that the fix works. == I posted the patch http://gcc.gnu.org/ml/gcc-patches/2010-04/msg01092.html it was reviewed with the conclusion that the patch would not work in all cases, there was some follow-up discussion and a follow-up patch (which is probably mostly OK) in: http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01516.html ... at that point I ran out of time for this particular issue - Jason made a suggestion as to a new implementation but I've not had a chance to look at it. It's quite hard to address because the check is called from different places.
[Bug c++/17729] [4.4/4.5/4.6/4.7 Regression] Duplicate __attribute__((deprecated)) warning
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17729 --- Comment #21 from Paolo Carlini paolo.carlini at oracle dot com 2012-01-23 15:30:25 UTC --- The problem with testing for duplicate diagnostics is by now well known, I guess. What I couldn't figure out from the audit trail was whether the fix itself was ready to go in or not, the trail badly lacked information. Anyway, many thanks for adding it now. I suppose I should not assign the bug to you? Or you actually feel like giving what Jason suggested a try?
[Bug c++/17729] [4.4/4.5/4.6/4.7 Regression] Duplicate __attribute__((deprecated)) warning
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17729 --- Comment #22 from Iain Sandoe iains at gcc dot gnu.org 2012-01-23 15:47:18 UTC --- (In reply to comment #21) The problem with testing for duplicate diagnostics is by now well known, I guess. What I couldn't figure out from the audit trail was whether the fix itself was ready to go in or not, the trail badly lacked information. Anyway, many thanks for adding it now. I suppose I should not assign the bug to you? Or you actually feel like giving what Jason suggested a try? I have no time at present - the bug is on my list, so if no-one else addresses it, and some time becomes available, I'll claim it then ;)