• Stephan Bergmann's avatar
    New loplugin:external · 206b5b26
    Stephan Bergmann yazdı
    ...warning about (for now only) functions and variables with external linkage
    that likely don't need it.
    
    The problems with moving entities into unnamed namespacs and breaking ADL
    (as alluded to in comments in compilerplugins/clang/external.cxx) are
    illustrated by the fact that while
    
      struct S1 { int f() { return 0; } };
      int f(S1 s) { return s.f(); }
      namespace N {
        struct S2: S1 { int f() { return 1; } };
        int f(S2 s) { return s.f(); }
      }
      int main() { return f(N::S2()); }
    
    returns 1, both moving just the struct S2 into an nunnamed namespace,
    
      struct S1 { int f() { return 0; } };
      int f(S1 s) { return s.f(); }
      namespace N {
        namespace { struct S2: S1 { int f() { return 1; } }; }
        int f(S2 s) { return s.f(); }
      }
      int main() { return f(N::S2()); }
    
    as well as moving just the function f overload into an unnamed namespace,
    
      struct S1 { int f() { return 0; } };
      int f(S1 s) { return s.f(); }
      namespace N {
        struct S2: S1 { int f() { return 1; } };
        namespace { int f(S2 s) { return s.f(); } }
      }
      int main() { return f(N::S2()); }
    
    would each change the program to return 0 instead.
    
    Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c
    Reviewed-on: https://gerrit.libreoffice.org/60539
    Tested-by: Jenkins
    Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
    206b5b26
Adı
Son kayıt (commit)
Son güncelleme
..
modules Loading commit data...
add-modelines Loading commit data...
assemble-flatpak.sh Loading commit data...
bin_library_info.sh Loading commit data...
clipatchconfig.pl Loading commit data...
concat-deps.c Loading commit data...
create-ids Loading commit data...
create-tags Loading commit data...
createcomponent.xslt Loading commit data...
dbgsv.ini Loading commit data...
desktop-translate.pl Loading commit data...
dummy.po Loading commit data...
exectest.pl Loading commit data...
fix-includes.pl Loading commit data...
gdb-core-bt.sh Loading commit data...
gdb_cxa-atexit_trace-stdout Loading commit data...
gdbtrycatchtrace Loading commit data...
gdbtrycatchtrace-stdout Loading commit data...
generate-tokens.pl Loading commit data...
gentoken.pl Loading commit data...
getcompver.awk Loading commit data...
hrcex Loading commit data...
id-lang.map Loading commit data...
image-sort.pl Loading commit data...
install-gdb-printers Loading commit data...
install-sh Loading commit data...
localestr Loading commit data...
macosx-change-install-names.pl Loading commit data...
macosx-codesign-app-bundle Loading commit data...
macosx_menubar_modification.xsl Loading commit data...
make-raspbian-root-tarball Loading commit data...
make_installer.pl Loading commit data...
mkdocs.Makefile Loading commit data...
mkdocs.sh Loading commit data...
mkdocs_portal.sh Loading commit data...
mkonedoc.sh Loading commit data...
native-code.py Loading commit data...
ooinstall Loading commit data...
pack_images.py Loading commit data...
packcomponents.xslt Loading commit data...
packregistry.xslt Loading commit data...
par2script.pl Loading commit data...
polib.py Loading commit data...
pre2par.pl Loading commit data...
uiex Loading commit data...
uiimagelist.xsl Loading commit data...
version.py Loading commit data...
write_classpath.sh Loading commit data...