summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/conststringvar.cxx
AgeCommit message (Collapse)Author
2020-02-16Fix loplugin:conststringvarStephan Bergmann
...after abc0344a234567aee0edcb4523036758d966481d "convert conststringvar plugin to shared infrastructre", causing errors like > [C ] cppuhelper/source/findsofficepath.c > Assertion failed: (Ctx.getLangOpts().CPlusPlus), function isCXX11ConstantExpr, file llvm/llvm-project/clang/lib/AST/ExprConstant.cpp, line 14567. > Stack dump: [...] > 6 libsystem_c.dylib 0x00007fff7266ca1c abort + 120 > 7 libsystem_c.dylib 0x00007fff7266bcd6 err + 0 > 8 clang 0x000000010b857ca3 clang::Expr::isCXX11ConstantExpr(clang::ASTContext const&, clang::APValue*, clang::SourceLocation*) const (.cold.2) + 35 > 9 clang 0x0000000109f7497e clang::Expr::isCXX11ConstantExpr(clang::ASTContext const&, clang::APValue*, clang::SourceLocation*) const + 1022 > 10 plugin.so 0x00000001182741ab loplugin::SharedRecursiveASTVisitorBasic::VisitVarDecl(clang::VarDecl*) + 1051 [...] > clang-11: error: clang frontend command failed due to signal (use -v to see invocation) Change-Id: I18c37dba294b0effd85bead8aa6e5679f77502d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88777 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-13convert conststringvar plugin to shared infrastructreNoel Grandin
and move the duplicated hasExternalLinkage function to a common location Change-Id: I39a1990945666ff7a307b4ddd5e270da64ee1673 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88592 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-23filter out AST in more pluginsNoel Grandin
I seem to have missed quite a few in commit 9f4d23c15115d64febd6bf01f870cc157badd350 filter out some of the AST in the plugins This nets me another 14% improvement Change-Id: I39b980b49ced560f768045dbedd3ddfef29306c1 Reviewed-on: https://gerrit.libreoffice.org/59501 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-07Clean away temporarily added using declarationsStephan Bergmann
Change-Id: I26734c13515394162d88351a1cbe2b20abdac865
2017-01-11Some loplugin:conststringvar/stringconstant improvementsStephan Bergmann
Change-Id: I73f694e6dedb84b3fb3b63ffb9dcda2481bc403c
2017-01-10Work around problems with isCXX11ConstantExpr in template codeStephan Bergmann
> template<size_t Size> > bool checkOutput(ScDocument* pDoc, const ScRange& aOutRange, const char* aOutputCheck[][Size], const char* pCaption) > { > ... > const char* p = aOutputCheck[nRow][nCol]; in sc/qa/unit/helper/qahelper.hxx caused > assert(E->isRValue() && E->getType()->hasPointerRepresentation()); in Clang's EvaluatePointer (lib/AST/ExprConstant.cpp) to fire. In the template definition itself, Clang doesn't introduce ArrayToPointerDecay ImplicitCastExpr into the subscripting operations (while in any implicit specializations that it instantiates, it does). This is interesting: Up to C++11, [expr.sub] requires the operator to have pointer type (so array-to-pointer decay is clearly asked for). In C++14 (CWG1213), the operator can also be of array type but it is not explicitly specified whether array-to-pointer decay is to be performed. In upcoming C++17 (P0135R1), it specifies further that an operator of array type must be a glvalue but still does not explicitly specify whether array-to-pointer decay is to be performed. Maybe the definition of the subscripting operation in terms of *((E1)+(E2)) is meant to imply that, however. Change-Id: I67c7b0f34002387dbf746288630371877c6261ef
2017-01-10New loplugin:conststringvarStephan Bergmann
Change-Id: I16648b018ed0f69a085322cfb88481ee2a0c27ca