[cfe-dev] Clang-tidy crashes when string reference used as parameter

Stuart Thomson via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 5 02:11:59 PDT 2018


Hi Jonas,

Thanks for this. You're right, turning off the InnerPointer check eliminates the crash.

Stuart

From: Jonas Toth <development at jonas-toth.eu>
Sent: 04 September 2018 18:56
To: Stuart Thomson <Stuart.Thomson at eu.medical.canon>; cfe-dev at lists.llvm.org
Subject: Re: [cfe-dev] Clang-tidy crashes when string reference used as parameter


Hi Stuart,

i can reproduce the issue, but it is not within clang-tidy, directly but in the CSA. The following invocation is the only invocation that results in the segfault.

~/opt/llvm/build/bin/clang-tidy -checks=-*,clang-analyzer-cplusplus.InnerPointer clang-tidy-bug.cpp --

The bug is reported here: https://bugs.llvm.org/show_bug.cgi?id=38827

Best, Jonas

Am 04.09.2018 um 15:51 schrieb Stuart Thomson via cfe-dev:
Hi,

The following causes clang-tidy to crash:

test.cpp:
#include <string>

void func(std::string& s){s.c_str();}

command:
clang-tidy test.cpp --

I am on Windows, using clang 8 built from trunk last week. Clang-tidy still crashes when changing c_str() to data(), but does not crash if the parameter used is instead std::string s. Clang-check does not crash at all and is able to produce the AST.

Regards,
Stuart





_______________________________________________

cfe-dev mailing list

cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>

http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180905/78722042/attachment.html>


More information about the cfe-dev mailing list