From d46b9aa882ff04ca43736eb4290cd100e54d2de2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 16 Mar 2016 16:58:23 +0300 Subject: Fix V006 warning if in constructor present attribute A_NONNULL. --- src/rules/constructor.cpp | 3 ++- tests/testsrc/good/formatting.cpp | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/rules/constructor.cpp b/src/rules/constructor.cpp index 8777ce1..e1795cb 100644 --- a/src/rules/constructor.cpp +++ b/src/rules/constructor.cpp @@ -57,7 +57,8 @@ parseLineRule(constructor) } else { - if (data.find("(") != std::string::npos) + if (data.find("(") != std::string::npos && + data.find("A_NONNULL(") == std::string::npos) { align = 0 ; const size_t sz = data.size(); diff --git a/tests/testsrc/good/formatting.cpp b/tests/testsrc/good/formatting.cpp index 2819d56..6d4d47a 100644 --- a/tests/testsrc/good/formatting.cpp +++ b/tests/testsrc/good/formatting.cpp @@ -49,3 +49,18 @@ struct Test3 final { } } + +struct ParticleTimer final +{ + ParticleTimer(Particle *const particle0, + const int endTime0) A_NONNULL(2) : + particle(particle0), + endTime(endTime0) + { + } + + Particle *particle; + int endTime; + Particle *const particle; + const int endTime; +}; -- cgit v1.2.3-70-g09d2