brintos

brintos / llvm-project-archived public Read only

0
0
Text · 599 B · 16d3b89 Raw
27 lines · cpp
1// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedLocalVarsChecker -verify %s2 3#include "mock-types.h"4 5class RenderStyle;6 7class FillLayer {8public:9    void ref() const;10    void deref() const;11};12 13class FillLayersPropertyWrapper {14public:15    typedef const FillLayer& (RenderStyle::*LayersGetter)() const;16 17private:18    bool canInterpolate(const RenderStyle& from) const19    {20        auto* fromLayer = &(from.*m_layersGetter)();21        // expected-warning@-1{{Local variable 'fromLayer' is uncounted and unsafe}}22        return true;23    }24 25    LayersGetter m_layersGetter;26};27