Fix ordering of const and mutable keywords (#56027)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56027

Changelog: [Internal]

The current implementation swaps the ordering of `const` and `mutable` keywords. This diff fixes it.

Reviewed By: cortinico

Differential Revision: D95912404

fbshipit-source-id: 6f726f0793b129fdd85b34b4c92dd22cf11bfb41
This commit is contained in:
Jakub Piasecki authored and meta-codesync[bot] committed 2026-03-11 00:18:57 -07:00
1 parent 94f40e7591
commit 7425a5f9c6
3 files changed
+27 -3

No files matched your search

+3 -3
View File
@@ -171,12 +171,12 @@ class VariableMember(Member):
if self.is_constexpr:
result += "constexpr "
if self.is_const and not self.is_constexpr:
result += "const "
if self.is_mutable:
result += "mutable "
if self.is_const and not self.is_constexpr:
result += "const "
if self._is_function_pointer():
formatted_args = format_arguments(self._fp_arguments)
qualified_type = format_parsed_type(self._parsed_type)
@@ -0,0 +1,5 @@
class test::Cache {
public const int* constPtr;
public mutable const int* mutableConstPtr;
public mutable int* mutablePtr;
}
@@ -0,0 +1,19 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
namespace test {
class Cache {
public:
mutable int *mutablePtr;
const int *constPtr;
mutable const int *mutableConstPtr;
};
} // namespace test