Skip to content

False positive for runtime/explicit on deleted constructors #386

@ptomato

Description

@ptomato

Deleted constructors shouldn't need to be marked explicit, because they can't be called implicitly.

Test case: explicit.cpp

// Copyright 2025 The Public Domain
class A {};

class B {
  B(A) = delete;
};

Actual output:

$ cpplint --version
Cpplint fork (https://github.com/cpplint/cpplint)
cpplint 2.0.2
Python 3.13.5 (main, Jun 12 2025, 00:00:00) [GCC 15.1.1 20250521 (Red Hat 15.1.1-2)]
$ cpplint explicit.cpp
explicit.cpp:5:  Single-parameter constructors should be marked explicit.  [runtime/explicit] [4]
Done processing explicit.cpp
Total errors found: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy