This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Disambiguate calls to log
ClosedPublic

Authored by ro on Aug 27 2023, 12:08 PM.

Details

Summary

c8644b18f570be9d26d83cdeeb2369cd3cbddaf1 broke the Solaris/amd64 and Solaris/sparcv9 buildbots:

FAILED: tools/clang/tools/extra/clang-tidy/altera/CMakeFiles/obj.clangTidyAlteraModule.dir/UnrollLoopsCheck.cpp.o
[...]
/vol/llvm/src/llvm-project/dist/clang-tools-extra/clang-tidy/altera/UnrollLoopsCheck.cpp:217:25: error: call to 'log' is ambiguous 
  217 |       Iterations = 1 + (log(EndValue) - log(InitValue)) / log(ConstantValue);
      |                         ^~~
/usr/include/iso/math_iso.h:60:15: note: candidate function
   60 | extern double log __P((double));
      |               ^
/usr/include/iso/math_iso.h:158:15: note: candidate function
  158 |         inline float log(float __X) { return __logf(__X); }
      |                      ^
/usr/include/iso/math_iso.h:193:21: note: candidate function
  193 |         inline long double log(long double __X) { return __logl(__X); }
      |                            ^

Fixed by disambituating the calls with double casts.

Tested on amd64-pc-solaris2.11 and x86_64-pc-linux-gnu.

Will commit shortly to unbreak the bots.

Diff Detail

Event Timeline

ro created this revision.Aug 27 2023, 12:08 PM
Herald added a project: Restricted Project. · View Herald Transcript
ro requested review of this revision.Aug 27 2023, 12:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 27 2023, 12:08 PM
This revision was not accepted when it landed; it landed in state Needs Review.Aug 27 2023, 12:16 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.