| 2840 | }; |
| 2841 | |
| 2842 | static bool isDecayedPointer(const Token *tok) |
| 2843 | { |
| 2844 | if (!tok) |
| 2845 | return false; |
| 2846 | if (!tok->astParent()) |
| 2847 | return false; |
| 2848 | if (Token::simpleMatch(tok->astParent(), "=") && astIsRHS(tok)) |
| 2849 | return true; |
| 2850 | if (astIsPointer(tok->astParent()) && !Token::simpleMatch(tok->astParent(), "return")) |
| 2851 | return true; |
| 2852 | if (tok->astParent()->isConstOp()) |
| 2853 | return true; |
| 2854 | if (!Token::simpleMatch(tok->astParent(), "return")) |
| 2855 | return false; |
| 2856 | return astIsPointer(tok->astParent()) || astIsContainerView(tok->astParent()); |
| 2857 | } |
| 2858 | |
| 2859 | static bool isConvertedToView(const Token* tok, const Settings& settings) |
| 2860 | { |
no test coverage detected