Skip to content

Commit fd791a4

Browse files
committed
Make argc mutable for compatibility (e.g., Qt), closes #899
1 parent 89f1830 commit fd791a4

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

include/cpp2util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@ struct args_t : std::vector<std::string_view>
17001700
{
17011701
args_t(int c, char** v) : vector{static_cast<std::size_t>(c)}, argc{c}, argv{v} {}
17021702

1703-
int argc = 0;
1703+
mutable int argc = 0; // mutable for compatibility with frameworks that take 'int& argc'
17041704
char** argv = nullptr;
17051705
};
17061706

regression-tests/test-results/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
cppfront compiler v0.3.0 Build 8C20:1033
2+
cppfront compiler v0.3.0 Build 8C20:1104
33
Copyright(c) Herb Sutter All rights reserved
44

55
SPDX-License-Identifier: CC-BY-NC-ND-4.0

source/build.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"8C20:1033"
1+
"8C20:1104"

0 commit comments

Comments
 (0)