mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Clean up remaining executable_semantics clang-tidy warnings (#906)
Co-authored-by: Geoff Romer <gromer@google.com>
This commit is contained in:
committed by
GitHub
co-authored by
Geoff Romer
parent
79e3d284b4
commit
057b9fe253
@@ -6,6 +6,7 @@
|
||||
#define EXECUTABLE_SEMANTICS_AST_DECLARATION_H_
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "common/ostream.h"
|
||||
@@ -38,7 +39,7 @@ class Declaration {
|
||||
};
|
||||
|
||||
Declaration(const Member&) = delete;
|
||||
Declaration& operator=(const Member&) = delete;
|
||||
auto operator=(const Member&) -> Declaration& = delete;
|
||||
|
||||
void Print(llvm::raw_ostream& out) const;
|
||||
LLVM_DUMP_METHOD void Dump() const { Print(llvm::errs()); }
|
||||
@@ -152,7 +153,7 @@ class ChoiceDeclaration : public Declaration {
|
||||
class Alternative {
|
||||
public:
|
||||
Alternative(std::string name, Nonnull<Expression*> signature)
|
||||
: name_(name), signature_(signature) {}
|
||||
: name_(std::move(name)), signature_(signature) {}
|
||||
|
||||
auto name() const -> const std::string& { return name_; }
|
||||
auto signature() const -> const Expression& { return *signature_; }
|
||||
|
||||
@@ -28,7 +28,7 @@ class Member {
|
||||
enum class Kind { FieldMember };
|
||||
|
||||
Member(const Member&) = delete;
|
||||
Member& operator=(const Member&) = delete;
|
||||
auto operator=(const Member&) -> Member& = delete;
|
||||
|
||||
void Print(llvm::raw_ostream& out) const;
|
||||
LLVM_DUMP_METHOD void Dump() const { Print(llvm::errs()); }
|
||||
|
||||
@@ -37,7 +37,7 @@ class Pattern {
|
||||
};
|
||||
|
||||
Pattern(const Pattern&) = delete;
|
||||
Pattern& operator=(const Pattern&) = delete;
|
||||
auto operator=(const Pattern&) -> Pattern& = delete;
|
||||
|
||||
void Print(llvm::raw_ostream& out) const;
|
||||
LLVM_DUMP_METHOD void Dump() const { Print(llvm::errs()); }
|
||||
@@ -206,7 +206,7 @@ class AlternativePattern : public Pattern {
|
||||
// expression.
|
||||
class ExpressionPattern : public Pattern {
|
||||
public:
|
||||
ExpressionPattern(Nonnull<Expression*> expression)
|
||||
explicit ExpressionPattern(Nonnull<Expression*> expression)
|
||||
: Pattern(Kind::ExpressionPattern, expression->source_loc()),
|
||||
expression_(expression) {}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class SourceLocation {
|
||||
auto operator=(const SourceLocation&) -> SourceLocation& = default;
|
||||
auto operator=(SourceLocation&&) -> SourceLocation& = default;
|
||||
|
||||
bool operator==(SourceLocation other) const {
|
||||
auto operator==(SourceLocation other) const -> bool {
|
||||
return filename_ == other.filename_ && line_num_ == other.line_num_;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user