Skip to content

CI: suppress -Wdeprecated-literal-operator failures on macOS - #333

Merged
Smattr merged 1 commit into
mainfrom
smattr/7bb8bfa1-c778-42c2-aab8-22e4dcfdb01f
Aug 12, 2026
Merged

Smattr merged 1 commit into
mainfrom
smattr/7bb8bfa1-c778-42c2-aab8-22e4dcfdb01f

Conversation

@Smattr

@Smattr Smattr commented Aug 11, 2026

Copy link
Copy Markdown
Owner

There is a C++11 defect report about a deprecated syntax for user-defined literals¹ that compilers seem to have mostly ignored before now. The macOS images seem to now pull in Clang 21 that warns about this, failing compilation:

  [  4%] Building CXX object librumur/CMakeFiles/librumur.dir/src/Boolean.cc.o
  In file included from rumur/rumur/wd/librumur/src/Boolean.cc:4:
  In file included from rumur/rumur/wd/librumur/include/rumur/Boolean.h:5:
  In file included from rumur/rumur/wd/librumur/include/rumur/Expr.h:6:
  /usr/local/include/gmpxx.h:2163:29: error: identifier '_mpz' preceded by
    whitespace in a literal operator declaration is deprecated
    [-Werror,-Wdeprecated-literal-operator]
   2163 | inline mpz_class operator"" _mpz(const char* s)
        |                  ~~~~~~~~~~~^~~~
        |                  operator""_mpz
  /usr/local/include/gmpxx.h:2168:29: error: identifier '_mpq' preceded by
    whitespace in a literal operator declaration is deprecated
    [-Werror,-Wdeprecated-literal-operator]
   2168 | inline mpq_class operator"" _mpq(const char* s)
        |                  ~~~~~~~~~~~^~~~
        |                  operator""_mpq
  /usr/local/include/gmpxx.h:2175:29: error: identifier '_mpf' preceded by
    whitespace in a literal operator declaration is deprecated
    [-Werror,-Wdeprecated-literal-operator]
   2175 | inline mpf_class operator"" _mpf(const char* s)
        |                  ~~~~~~~~~~~^~~~
        |                  operator""_mpf
  3 errors generated.

There are a number of things I do not understand about this:

  1. The GMP include directories are added as SYSTEM, so we should not be seeing compiler warnings from their headers.
  2. Of the 4 macOS jobs, the macOS+Macports+aarch64 is somehow not affected by this despite seemingly using the same compiler and GMP version.

The work arounds elsewhere on the internet are pretty unpleasant,² so lets do some targeted -Werror disabling instead.

¹ https://cplusplus.github.io/CWG/issues/2521.html
² SRI-CSL/libpoly#110

Gitlab: cvc5/cvc5-rs#56
Reported-by: AppleClang 21.0.0.21000101 -Wdeprecated-literal-operator

There is a C++11 defect report about a deprecated syntax for
user-defined literals¹ that compilers seem to have mostly ignored
before now. The macOS images seem to now pull in Clang 21 that warns
about this, failing compilation:

  [  4%] Building CXX object librumur/CMakeFiles/librumur.dir/src/Boolean.cc.o
  In file included from rumur/rumur/wd/librumur/src/Boolean.cc:4:
  In file included from rumur/rumur/wd/librumur/include/rumur/Boolean.h:5:
  In file included from rumur/rumur/wd/librumur/include/rumur/Expr.h:6:
  /usr/local/include/gmpxx.h:2163:29: error: identifier '_mpz' preceded by
    whitespace in a literal operator declaration is deprecated
    [-Werror,-Wdeprecated-literal-operator]
   2163 | inline mpz_class operator"" _mpz(const char* s)
        |                  ~~~~~~~~~~~^~~~
        |                  operator""_mpz
  /usr/local/include/gmpxx.h:2168:29: error: identifier '_mpq' preceded by
    whitespace in a literal operator declaration is deprecated
    [-Werror,-Wdeprecated-literal-operator]
   2168 | inline mpq_class operator"" _mpq(const char* s)
        |                  ~~~~~~~~~~~^~~~
        |                  operator""_mpq
  /usr/local/include/gmpxx.h:2175:29: error: identifier '_mpf' preceded by
    whitespace in a literal operator declaration is deprecated
    [-Werror,-Wdeprecated-literal-operator]
   2175 | inline mpf_class operator"" _mpf(const char* s)
        |                  ~~~~~~~~~~~^~~~
        |                  operator""_mpf
  3 errors generated.

There are a number of things I do not understand about this:
  1. The GMP include directories are added as `SYSTEM`, so we should not
     be seeing compiler warnings from their headers.
  2. Of the 4 macOS jobs, the macOS+Macports+aarch64 is somehow not
     affected by this despite seemingly using the same compiler and GMP
     version.

The work arounds elsewhere on the internet are pretty unpleasant,² so
lets do some targeted -Werror disabling instead.

¹ https://cplusplus.github.io/CWG/issues/2521.html
² SRI-CSL/libpoly#110

Gitlab: cvc5/cvc5-rs#56
Reported-by: AppleClang 21.0.0.21000101 -Wdeprecated-literal-operator
@Smattr
Smattr merged commit 205d9b6 into main Aug 12, 2026
18 of 22 checks passed
@Smattr
Smattr deleted the smattr/7bb8bfa1-c778-42c2-aab8-22e4dcfdb01f branch August 12, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant