On Mar 5, 2014, at 9:53 AM, David Blaikie <dblaikie at gmail.com> wrote:>> It might be reasonable to warn if a class has both a function marked >> 'override' and a function that overrides but is not marked 'override'. >> >> >> That could be useful - because it means that the author of the class is at >> least thinking about override - but having a "coding style" warning of "I >> always intend to use override" would still be useful. > > Doug (not sure about other Clang owners) is pretty hesitant about > implementing coding style warnings - anything with such a high false > positive rate as to be off by default is assumed to be a non-starter > in Clang (though perhaps things have changed in the years since I last > tested the waters here). > > And now that we have something like clang-tidy, it's perhaps less of > an issue... we'll see.Making it part of clang-tidy would make a lot of sense then! Is there any plans to get clang-tidy running against the llvm/clang codebases regularly, or is it already happening? -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140305/ae43e457/attachment.html>
On Wed, Mar 5, 2014 at 10:29 AM, Chris Lattner <clattner at apple.com> wrote:> On Mar 5, 2014, at 9:53 AM, David Blaikie <dblaikie at gmail.com> wrote: > > It might be reasonable to warn if a class has both a function marked > 'override' and a function that overrides but is not marked 'override'. > > > That could be useful - because it means that the author of the class is at > least thinking about override - but having a "coding style" warning of "I > always intend to use override" would still be useful. > > > Doug (not sure about other Clang owners) is pretty hesitant about > implementing coding style warnings - anything with such a high false > positive rate as to be off by default is assumed to be a non-starter > in Clang (though perhaps things have changed in the years since I last > tested the waters here). > > And now that we have something like clang-tidy, it's perhaps less of > an issue... we'll see. > > > Making it part of clang-tidy would make a lot of sense then! Is there any > plans to get clang-tidy running against the llvm/clang codebases regularly, > or is it already happening? >Alex and others here are actively working on it. I think Craig Topper has even used a prototype tidy check for this exact issue to do most of the cleanup. =] -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140305/8e5a0b9b/attachment.html>
On Mar 5, 2014, at 10:29 AM, Chris Lattner <clattner at apple.com> wrote:> > On Mar 5, 2014, at 9:53 AM, David Blaikie <dblaikie at gmail.com> wrote: > >>> It might be reasonable to warn if a class has both a function marked >>> 'override' and a function that overrides but is not marked 'override'. >>> >>> >>> That could be useful - because it means that the author of the class is at >>> least thinking about override - but having a "coding style" warning of "I >>> always intend to use override" would still be useful. >> >> Doug (not sure about other Clang owners) is pretty hesitant about >> implementing coding style warnings - anything with such a high false >> positive rate as to be off by default is assumed to be a non-starter >> in Clang (though perhaps things have changed in the years since I last >> tested the waters here). >> >> And now that we have something like clang-tidy, it's perhaps less of >> an issue... we'll see. > > Making it part of clang-tidy would make a lot of sense then! Is there any plans to get clang-tidy running against the llvm/clang codebases regularly, or is it already happening?I believe that the “clang-modernize” tool can add “override” in the appropriate places. http://stackoverflow.com/questions/7293715/is-there-a-tool-to-add-the-override-identifier-to-existing-c-code — Marshall -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140305/474b2e11/attachment.html>
On Wed, Mar 5, 2014 at 1:02 PM, Marshall Clow <mclow.lists at gmail.com> wrote:> > On Mar 5, 2014, at 10:29 AM, Chris Lattner <clattner at apple.com> wrote: > > > On Mar 5, 2014, at 9:53 AM, David Blaikie <dblaikie at gmail.com> wrote: > > It might be reasonable to warn if a class has both a function marked > 'override' and a function that overrides but is not marked 'override'. > > > That could be useful - because it means that the author of the class is at > least thinking about override - but having a "coding style" warning of "I > always intend to use override" would still be useful. > > > Doug (not sure about other Clang owners) is pretty hesitant about > implementing coding style warnings - anything with such a high false > positive rate as to be off by default is assumed to be a non-starter > in Clang (though perhaps things have changed in the years since I last > tested the waters here). > > And now that we have something like clang-tidy, it's perhaps less of > an issue... we'll see. > > > Making it part of clang-tidy would make a lot of sense then! Is there any > plans to get clang-tidy running against the llvm/clang codebases regularly, > or is it already happening? > > > I believe that the “clang-modernize” tool can add “override” in the > appropriate places. > > http://stackoverflow.com/questions/7293715/is-there-a-tool-to-add-the-override-identifier-to-existing-c-code >Can it also delete "virtual" if it has "override"?> > — Marshall > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140305/6d5835ea/attachment.html>