From 314f15bff08b76bf96acf99141776ef64d2f1355 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 16 Nov 2019 21:00:53 +0100 Subject: Extend loplugin:external to warn about enums To mitigate the dangers of silently breaking ADL when moving enums into unnamed namespaces (see the commit message of 206b5b2661be37efdff3c6aedb6f248c4636be79 "New loplugin:external"), note all functions that are affected. (The plan is to extend loplugin:external further to also warn about classes and class templates, and the code to identify affected functions already takes that into account, so some parts of that code are not actually relevant for enums.) But it appears that none of the functions that are actually affected by the changes in this commit relied on being found through ADL, so no adaptions were necessary for them. (clang::DeclContext::collectAllContexts is non-const, which recursively means that External's Visit... functions must take non-const Decl*. Which required compilerplugins/clang/sharedvisitor/analyzer.cxx to be generalized to support such Visit... functions with non-const Decl* parameters.) Change-Id: Ia215291402bf850d43defdab3cff4db5b270d1bd Reviewed-on: https://gerrit.libreoffice.org/83001 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- sal/osl/unx/profile.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sal/osl/unx') diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index 44e7243c4b13..ad8868b5490c 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -51,11 +51,15 @@ typedef time_t osl_TStamp; +namespace { + enum osl_TLockMode { un_lock, read_lock, write_lock }; +} + struct osl_TFile { int m_Handle; -- cgit v1.2.3