Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2765)

Issue 551320043: Issue 5650: Use C++11 "override" keyword (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years, 2 months ago by Dan Eble
Modified:
4 years, 2 months ago
Reviewers:
carl.d.sorensen, Carl
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

https://sourceforge.net/p/testlilyissues/issues/5650/ 1: Remove unnecessary include and namespace use 2: Check name in DECLARE_CLASSNAME() 3: Separate DECLARE_CLASSNAME() from VIRTUAL_COPY_CONSTRUCTOR() 4: Eliminate VIRTUAL_COPY_CONSTRUCTOR() Just write out the virtual clone() function. 5: Use C++11 "override" keyword throughout the code The chosen style is to state "virtual" for the base function only, because "override" implies "virtual". 6: Compile with -Werror=suggest-override, when supported This fails the build if a virtual method is overridden without using the "override" keyword. This complements the standard behavior of failing the build if a virtual method with the "override" keyword does not actually override anything.

Patch Set 1 : Remove unnecessary include and namespace use #

Patch Set 2 : Check name in DECLARE_CLASSNAME() #

Patch Set 3 : Separate DECLARE_CLASSNAME() from VIRTUAL_COPY_CONSTRUCTOR() #

Patch Set 4 : Eliminate VIRTUAL_COPY_CONSTRUCTOR() #

Patch Set 5 : Use C++11 "override" keyword throughout the code #

Patch Set 6 : Compile with -Werror=suggest-override, when supported #

Unified diffs Side-by-side diffs Delta from patch set Stats (+425 lines, -408 lines) Patch
M configure.ac View 1 2 3 4 5 1 chunk +12 lines, -0 lines 0 comments Download
M flower/include/virtual-methods.hh View 1 2 3 4 1 chunk +16 lines, -19 lines 0 comments Download
M flower/include/yaffut.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/accidental-engraver.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/ambitus-engraver.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/apply-context-iterator.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/auto-beam-engraver.cc View 1 2 3 4 2 chunks +5 lines, -5 lines 0 comments Download
M lily/auto-change-iterator.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/axis-group-engraver.cc View 1 2 3 4 1 chunk +5 lines, -5 lines 0 comments Download
M lily/balloon-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/bar-check-iterator.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/beam-collision-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/beam-engraver.cc View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M lily/bend-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/break-align-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/chord-name-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/chord-tremolo-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/clef-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/cluster-engraver.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/completion-note-heads-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/completion-rest-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/concurrent-hairpin-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/context-specced-music-iterator.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/control-track-performer.cc View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M lily/cue-clef-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/custos-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/dynamic-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/dynamic-performer.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/episema-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/extender-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/figured-bass-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/figured-bass-position-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/footnote-engraver.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/fretboard-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/glissando-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/grace-engraver.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/grob-pq-engraver.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/hyphen-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/audio-element.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/book.hh View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M lily/include/change-iterator.hh View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/include/change-sequence-iterator.hh View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/include/chord-tremolo-iterator.hh View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/include/coherent-ligature-engraver.hh View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/include/context.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/context-def.hh View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M lily/include/engraver.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/engraver-group.hh View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M lily/include/event-chord-iterator.hh View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M lily/include/event-iterator.hh View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M lily/include/font-metric.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/global-context.hh View 1 2 3 4 2 chunks +5 lines, -5 lines 0 comments Download
M lily/include/grace-iterator.hh View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M lily/include/gregorian-ligature-engraver.hh View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/include/grob.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/item.hh View 1 2 3 4 3 chunks +11 lines, -11 lines 0 comments Download
M lily/include/ligature-engraver.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/lily-lexer.hh View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download
M lily/include/midi-chunk.hh View 1 2 3 4 4 chunks +4 lines, -4 lines 0 comments Download
M lily/include/midi-item.hh View 1 2 3 4 13 chunks +22 lines, -22 lines 0 comments Download
M lily/include/minimal-page-breaking.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/modified-font-metric.hh View 1 2 3 4 1 chunk +11 lines, -11 lines 0 comments Download
M lily/include/music.hh View 1 2 3 4 2 chunks +5 lines, -4 lines 0 comments Download
M lily/include/music-iterator.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/music-output.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/music-wrapper-iterator.hh View 1 2 3 4 1 chunk +12 lines, -12 lines 0 comments Download
M lily/include/one-line-auto-height-breaking.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/one-line-page-breaking.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/one-page-breaking.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/open-type-font.hh View 1 2 3 4 2 chunks +10 lines, -10 lines 0 comments Download
M lily/include/optimal-page-breaking.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/output-def.hh View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M lily/include/page-marker.hh View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M lily/include/page-turn-page-breaking.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/pango-font.hh View 1 2 3 4 2 chunks +7 lines, -7 lines 0 comments Download
M lily/include/paper-column.hh View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M lily/include/paper-column-engraver.hh View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/include/paper-score.hh View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M lily/include/performance.hh View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M lily/include/performer.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/performer-group.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/prob.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/property-iterator.hh View 1 2 3 4 2 chunks +8 lines, -8 lines 0 comments Download
M lily/include/rhythmic-music-iterator.hh View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M lily/include/scheme-engraver.hh View 1 2 3 4 1 chunk +6 lines, -6 lines 0 comments Download
M lily/include/score.hh View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M lily/include/score-engraver.hh View 1 2 3 4 1 chunk +7 lines, -6 lines 0 comments Download
M lily/include/score-performer.hh View 1 2 3 4 2 chunks +7 lines, -7 lines 0 comments Download
M lily/include/sequential-iterator.hh View 1 2 3 4 1 chunk +9 lines, -9 lines 0 comments Download
M lily/include/simple-music-iterator.hh View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M lily/include/simultaneous-music-iterator.hh View 1 2 3 4 1 chunk +9 lines, -9 lines 0 comments Download
M lily/include/slur-engraver.hh View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/include/spanner.hh View 1 2 3 4 3 chunks +7 lines, -7 lines 0 comments Download
M lily/include/stream-event.hh View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M lily/include/system.hh View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
M lily/include/timing-translator.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/include/translator.hh View 1 2 3 4 4 chunks +5 lines, -5 lines 0 comments Download
M lily/include/translator-group.hh View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/instrument-name-engraver.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/instrument-switch-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/keep-alive-together-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/key-engraver.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/kievan-ligature-engraver.cc View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M lily/ledger-line-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/lyric-combine-music-iterator.cc View 1 2 3 4 1 chunk +8 lines, -8 lines 0 comments Download
M lily/mark-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/measure-grouping-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/mensural-ligature-engraver.cc View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M lily/metronome-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/midi-cc-performer.cc View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
M lily/note-spacing-engraver.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/ottava-engraver.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/output-property-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/page-turn-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/parenthesis-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/part-combine-iterator.cc View 1 2 3 4 1 chunk +7 lines, -7 lines 0 comments Download
M lily/part-combine-part-iterator.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/partial-iterator.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/percent-repeat-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/percent-repeat-iterator.cc View 1 2 3 4 1 chunk +5 lines, -5 lines 0 comments Download
M lily/phrasing-slur-engraver.cc View 1 2 3 4 1 chunk +5 lines, -5 lines 0 comments Download
M lily/piano-pedal-align-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/piano-pedal-engraver.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M lily/piano-pedal-performer.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/pure-from-neighbor-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/quote-iterator.cc View 1 2 3 4 1 chunk +6 lines, -6 lines 0 comments Download
M lily/repeat-acknowledge-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/repeat-tie-engraver.cc View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M lily/spacing-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/span-bar-stub-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/staff-performer.cc View 1 2 3 4 2 chunks +5 lines, -5 lines 0 comments Download
M lily/staff-symbol-engraver.cc View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M lily/stanza-number-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/stem-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/system-start-delimiter-engraver.cc View 1 2 3 4 3 chunks +7 lines, -7 lines 0 comments Download
M lily/tempo-performer.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/text-spanner-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/tie-performer.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/time-signature-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/time-signature-performer.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/trill-spanner-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/tuplet-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/tuplet-iterator.cc View 1 2 3 4 1 chunk +5 lines, -5 lines 0 comments Download
M lily/tweak-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/vaticana-ligature-engraver.cc View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M lily/vertical-align-engraver.cc View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M lily/volta-engraver.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/volta-repeat-iterator.cc View 1 2 3 4 1 chunk +5 lines, -5 lines 0 comments Download

Messages

Total messages: 6
Dan Eble
Check name in DECLARE_CLASSNAME()
4 years, 2 months ago (2020-01-01 22:09:03 UTC) #1
Dan Eble
Separate DECLARE_CLASSNAME() from VIRTUAL_COPY_CONSTRUCTOR()
4 years, 2 months ago (2020-01-01 22:09:43 UTC) #2
Dan Eble
Eliminate VIRTUAL_COPY_CONSTRUCTOR()
4 years, 2 months ago (2020-01-01 22:10:03 UTC) #3
Dan Eble
Use C++11 "override" keyword throughout the code
4 years, 2 months ago (2020-01-01 22:11:15 UTC) #4
Dan Eble
Compile with -Werror=suggest-override, when supported
4 years, 2 months ago (2020-01-01 22:12:54 UTC) #5
Carl
4 years, 2 months ago (2020-01-02 01:13:49 UTC) #6
LGTM.

Thanks for using the C++11 standard stuff to go to C++ usage instead of custom
LilyPond code.

Carl
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b