You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clang is behaving correctly here. A regparm-attributed member function pointer type is distinct from a non-regparm-attributed member function pointer type, so they'll have different template specializations. GCC's behavior appears to be inconsistent here, because the types are considered equivalent for the purposes of matching template arguments, so the regparm attribute associated with the first instantiation is the one that "sticks", even if subsequent instantiations don't have the regparm attribute.
llvmbot
transferred this issue from llvm/llvm-bugzilla-archive
Dec 3, 2021
Extended Description
Clang rejects and gcc accepts the following code:
template struct nsRunnableMethodTraits {
};
//template struct nsRunnableMethodTraits<void attribute ((regparm (0))) (C::)()> {
template struct nsRunnableMethodTraits<void (C::)()> {
typedef int base_type;
};
template typename nsRunnableMethodTraits::base_type* NS_NewRunnableMethod(Method method) ;
struct C1 {
virtual void attribute ((regparm (0))) FinishStream(void) {
NS_NewRunnableMethod( &C1::FinishStream);
}
};
Changing which line make clang accept the code.
The text was updated successfully, but these errors were encountered: