Skip to content

cpplint gives bogus error on rvalue reference #61

@janusw

Description

@janusw

On the following C++ code

#include <string>

int main() {
  struct A {
    A(std::string s, A&& a);
  };
}

cpplint complains:

rvalue_ref.cpp:5:  Missing spaces around &&  [whitespace/operators] [3]

It seems that the rvalue reference is misinterpreted as an operator. When making s an int, this turns into the expected:

rvalue_ref.cpp:5:  RValue references are an unapproved C++ feature.  [build/c++11] [3]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions