After running the tool aginst LLD, I realized that clang-modernize do not add "override" to virtual destructors. I think it's not intended but just that that case is not covered by the tool. On Wed, Mar 5, 2014 at 2:54 PM, Craig Topper <craig.topper at gmail.com> wrote:> Didn't realize that. I'll see if i can figure out how to make it delete > the virtual keyword. > > > On Wed, Mar 5, 2014 at 2:32 PM, Ben Langmuir <blangmuir at apple.com> wrote: > >> clang-modernize has a -format option that will run clang-format on the >> code it changes. >> >> Ben >> >> >> >> On Mar 5, 2014, at 2:26 PM, Craig Topper <craig.topper at gmail.com> wrote: >> >> clang-modernize can add the 'override', but it can't currently delete >> 'virtual'. It will also potentially overflow 80 columns. And if it removed >> virtual it would fail to align a second line of arguments correctly. So you >> need modernize and clang-format I guess. Though I'm not sure we want to >> widespread apply clang-format. >> >> >> On Wed, Mar 5, 2014 at 1:10 PM, Rui Ueyama <ruiu at google.com> wrote: >> >>> 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 >>>> >>>> >>> >>> _______________________________________________ >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>> >>> >> >> >> -- >> ~Craig >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> >> > > > -- > ~Craig >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140306/ab3598da/attachment.html>
It also doesn't do pure methods either. On Thursday, March 6, 2014, Rui Ueyama <ruiu at google.com> wrote:> After running the tool aginst LLD, I realized that clang-modernize do not > add "override" to virtual destructors. I think it's not intended but just > that that case is not covered by the tool. > > > On Wed, Mar 5, 2014 at 2:54 PM, Craig Topper <craig.topper at gmail.com>wrote: > > Didn't realize that. I'll see if i can figure out how to make it delete > the virtual keyword. > > > On Wed, Mar 5, 2014 at 2:32 PM, Ben Langmuir <blangmuir at apple.com> wrote: > > clang-modernize has a -format option that will run clang-format on the > code it changes. > > Ben > > > > On Mar 5, 2014, at 2:26 PM, Craig Topper <craig.topper at gmail.com> wrote: > > clang-modernize can add the 'override', but it can't currently delete > 'virtual'. It will also potentially overflow 80 columns. And if it removed > virtual it would fail to align a second line of arguments correctly. So you > need modernize and clang-format I guess. Though I'm not sure we want to > widespread apply clang-format. > > > On Wed, Mar 5, 2014 at 1:10 PM, Rui Ueyama <ruiu at google.com> wrote: > > 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 > >-- ~Craig -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140306/d554a614/attachment.html>
On Thu, Mar 6, 2014 at 2:21 PM, Craig Topper <craig.topper at gmail.com> wrote:> It also doesn't do pure methods either.I think I don't quite understand what that means. Can you give me an example?> On Thursday, March 6, 2014, Rui Ueyama <ruiu at google.com> wrote: > >> After running the tool aginst LLD, I realized that clang-modernize do not >> add "override" to virtual destructors. I think it's not intended but just >> that that case is not covered by the tool. >> >> >> On Wed, Mar 5, 2014 at 2:54 PM, Craig Topper <craig.topper at gmail.com>wrote: >> >> Didn't realize that. I'll see if i can figure out how to make it delete >> the virtual keyword. >> >> >> On Wed, Mar 5, 2014 at 2:32 PM, Ben Langmuir <blangmuir at apple.com> wrote: >> >> clang-modernize has a -format option that will run clang-format on the >> code it changes. >> >> Ben >> >> >> >> On Mar 5, 2014, at 2:26 PM, Craig Topper <craig.topper at gmail.com> wrote: >> >> clang-modernize can add the 'override', but it can't currently delete >> 'virtual'. It will also potentially overflow 80 columns. And if it removed >> virtual it would fail to align a second line of arguments correctly. So you >> need modernize and clang-format I guess. Though I'm not sure we want to >> widespread apply clang-format. >> >> >> On Wed, Mar 5, 2014 at 1:10 PM, Rui Ueyama <ruiu at google.com> wrote: >> >> 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 >> >> > > -- > ~Craig >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140306/5d092ba6/attachment.html>