call to 'FillVRegs' is ambiguous

Bug #2098147 reported by Dominik Viererbe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
android-platform-art (Ubuntu)
In Progress
Undecided
Dominik Viererbe

Bug Description

When building android-platform-art with clang 20 the call to 'FillVRegs' is ambiguous. See the following error message:

runtime/art_method-inl.h:173:3: error: call to 'FillVRegs' is ambiguous
  173 | FillVRegs<ArgType...>(vregs.data(), args...);
      | ^~~~~~~~~~~~~~~~~~~~~
runtime/art_method-inl.h:200:24: note: in instantiation of function template specialization 'art::detail::MaterializeVRegs<'L', 'L'>' requested here
  200 | auto vregs = detail::MaterializeVRegs<'L', ArgType...>(receiver, args...);
      | ^
runtime/art_method-inl.h:229:25: note: in instantiation of function template specialization 'art::ArtMethod::InvokeInstance<'L', 'L'>' requested here
  229 | return target_method->InvokeInstance<ReturnType, ArgType...>(self, receiver, args...);
      | ^
runtime/class_linker.cc:3241:64: note: in instantiation of function template specialization 'art::ArtMethod::InvokeVirtual<'L', 'L'>' requested here
 3241 | WellKnownClasses::java_lang_ClassLoader_loadClass->InvokeVirtual<'L', 'L'>(
      | ^
runtime/art_method-inl.h:155:27: note: candidate function [with ArgType = <'L', 'L'>]
  155 | inline ALWAYS_INLINE void FillVRegs(uint32_t* vregs ATTRIBUTE_UNUSED,
      | ^
runtime/art_method-inl.h:160:27: note: candidate function [with FirstArgType = 'L', ArgType = <'L'>]
  160 | inline ALWAYS_INLINE void FillVRegs(uint32_t* vregs,
      |

I already have a patch for this: that seems to work:

--- a/runtime/art_method-inl.h
+++ b/runtime/art_method-inl.h
@@ -151,7 +151,7 @@
   return sum;
 }

-template <char... ArgType>
+template <char... ArgType, std::enable_if_t<sizeof...(ArgType) == 0, int> = 0>
 inline ALWAYS_INLINE void FillVRegs(uint32_t* vregs ATTRIBUTE_UNUSED,
                                     typename ShortyTraits<ArgType>::Type... args ATTRIBUTE_UNUSED)
     REQUIRES_SHARED(Locks::mutator_lock_) {}

Changed in android-platform-art (Ubuntu):
status: New → In Progress
assignee: nobody → Dominik Viererbe (dviererbe)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.