diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-17 14:33:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-17 14:33:15 +0000 |
commit | d1fc48f20fb2c44bba1499b79016fb778a295f23 (patch) | |
tree | a1cb3b0ee521bf3ff444b1ffdda847f1b4d149ca /gcc | |
parent | f8ae675c108a075012d0edb5c3cce972182803cb (diff) | |
parent | 59a560263724aaa6b0549866e7a09c95eea7a9ce (diff) | |
download | gcc-d1fc48f20fb2c44bba1499b79016fb778a295f23.zip gcc-d1fc48f20fb2c44bba1499b79016fb778a295f23.tar.gz gcc-d1fc48f20fb2c44bba1499b79016fb778a295f23.tar.bz2 |
Merge #499
499: Cleanup warnings r=philberty a=philberty
This adds the missing override specifier to as_string on identifier
patterns and ensures rust_debug gains printf specifier checks.
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-pattern.h | 2 | ||||
-rw-r--r-- | gcc/rust/rust-diagnostics.cc | 2 | ||||
-rw-r--r-- | gcc/rust/rust-diagnostics.h | 12 |
3 files changed, 6 insertions, 10 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-pattern.h b/gcc/rust/hir/tree/rust-hir-pattern.h index 13177f2..27cba7d 100644 --- a/gcc/rust/hir/tree/rust-hir-pattern.h +++ b/gcc/rust/hir/tree/rust-hir-pattern.h @@ -77,7 +77,7 @@ public: Location locus; - std::string as_string () const; + std::string as_string () const override; // Returns whether the IdentifierPattern has a pattern to bind. bool has_pattern_to_bind () const { return to_bind != nullptr; } diff --git a/gcc/rust/rust-diagnostics.cc b/gcc/rust/rust-diagnostics.cc index 6f405c9..0725b08 100644 --- a/gcc/rust/rust-diagnostics.cc +++ b/gcc/rust/rust-diagnostics.cc @@ -198,7 +198,7 @@ rust_error_at (const RichLocation location, const char *fmt, ...) } void -rust_debug (const Location location, const char *fmt, ...) +rust_debug_loc (const Location location, const char *fmt, ...) { if (!rust_be_debug_p ()) return; diff --git a/gcc/rust/rust-diagnostics.h b/gcc/rust/rust-diagnostics.h index 6c179f9..024593d 100644 --- a/gcc/rust/rust-diagnostics.h +++ b/gcc/rust/rust-diagnostics.h @@ -127,14 +127,10 @@ struct Error } // namespace Rust // rust_debug uses normal printf formatting, not GCC diagnostic formatting. -void -rust_debug (const Location location, const char *fmt, ...) ATTRIBUTE_PRINTF_2; +#define rust_debug(...) rust_debug_loc (Location (), __VA_ARGS__) -template <typename... Args> -inline void -rust_debug (const char *fmt, Args... args) -{ - rust_debug (Location (), fmt, args...); -} +void +rust_debug_loc (const Location location, const char *fmt, + ...) ATTRIBUTE_PRINTF_2; #endif // !defined(RUST_DIAGNOSTICS_H) |