Bug ID: 393038
           Summary: False positive check "function-args-by-value".
                    Template override case.
           Product: clazy
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
  Target Milestone: ---


Maybe this is duplicate for issue,
but because i cannot check i create new issue.

In my project i have this code:
class MyClass
    template <typename T>
    void SetAttribute(QDomElement &domElement, const QString &name, const T
&value) const;

template <typename T>
inline void MyClass::SetAttribute(QDomElement &domElement, const QString &name,
const T &value) const
    // See specification for xs:decimal
    const QLocale locale = QLocale::c();

template <>
inline void MyClass::SetAttribute<QString>(QDomElement &domElement, const
QString &name, const QString &value) const
    domElement.setAttribute(name, value);

template <>
inline void MyClass::SetAttribute<QChar>(QDomElement &domElement, const QString
&name, const QChar &value) const
    domElement.setAttribute(name, value);

template <>
inline void MyClass::SetAttribute<bool>(QDomElement &domElement, const QString
&name, const bool &value) const
    domElement.setAttribute(name, value ? QStringLiteral("true") :

Clazy correctly warns about bool and QChar arguments, but i cannot change the
function declaration, it won't compile with error "no function template matches
function template specialization 'SetAttribute'".

You are receiving this mail because:
You are watching all bug changes.

Reply via email to