pw_rpc: Fix lock.h from gcc bug

A gcc bug in 8.4 is causing an error when parsing [[maybe_unused]]
when it's the first parameter. Reordering fixes the issue.

Context: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81429
Change-Id: Ib6dd90e87de5dc7213ebbc5ad07105a9c7998421
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/85840
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Rob Oliver <rgoliver@google.com>
diff --git a/pw_rpc/public/pw_rpc/internal/lock.h b/pw_rpc/public/pw_rpc/internal/lock.h
index efb0443..50c53d5 100644
--- a/pw_rpc/public/pw_rpc/internal/lock.h
+++ b/pw_rpc/public/pw_rpc/internal/lock.h
@@ -41,7 +41,9 @@
 
 class PW_SCOPED_LOCKABLE LockGuard {
  public:
-  constexpr LockGuard([[maybe_unused]] RpcLock& mutex)
+  // [[maybe_unused]] needs to be after the parameter to workaround a gcc bug
+  // context: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81429
+  constexpr LockGuard(RpcLock& mutex [[maybe_unused]])
       PW_EXCLUSIVE_LOCK_FUNCTION(mutex) {}
 
   ~LockGuard() PW_UNLOCK_FUNCTION() = default;