Skip to content

-Wunsequenced should warn on "std::unique_ptr p; f(p.get(), std::move(p));" #21193

@nico

Description

@nico
Bugzilla Link 20819
Version trunk
OS All
CC @DougGregor,@martinboehme,@riccibruno,@zygoloid,@rnk

Extended Description

-Wunsequenced should warn on this:

#include

void f(int *p, std::unique_ptr foo) {}

int main() {
std::unique_ptr p;
f(p.get(), std::move(p));
}

(motivated by http://crbug.com/409318)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second party

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions