]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cobol: Avoid a use of auto.
authorIain Sandoe <iain@sandoe.co.uk>
Mon, 17 Mar 2025 10:04:52 +0000 (10:04 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Tue, 18 Mar 2025 14:48:07 +0000 (14:48 +0000)
In this case the deduction for Darwin's implementation is 'char *' which
then conflicts with the second use of data.initial in the find_if
callback.  Let's just specify it as 'const char *'.

gcc/cobol/ChangeLog:

* util.cc (cbl_field_t::report_invalid_initial_value): Avoid
auto here and specify const char *.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/cobol/util.cc

index 9f746a388081639317656173670d31b90019293a..3872f57aeb0ab63c70ee5e71e0b50a1c5d6dd6b7 100644 (file)
@@ -850,7 +850,7 @@ cbl_field_t::report_invalid_initial_value(const YYLTYPE& loc) const {
         /*
          * Check fraction for excess precision
          */
-        auto p = strchr(data.initial, symbol_decimal_point());
+        const char *p = strchr(data.initial, symbol_decimal_point());
         if( p ) {
           auto pend = std::find(p, p + strlen(p), 0x20);
           int n = std::count_if( ++p, pend, isdigit );