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
C:\Users\vhtmf\Documents\Arduino\sketch_feb10a\sketch_feb10a.ino: In instantiation of 'constexpr const bool _Allow_inheriting_unwrap<unsigned int*, void>::value':
C:\Users\vhtmf\Documents\Arduino\sketch_feb10a\sketch_feb10a.ino:22:70: required from here
C:\Users\vhtmf\Documents\Arduino\sketch_feb10a\sketch_feb10a.ino:19:25: error: 'unsigned int*' is not a class, struct, or union type
static constexpr bool value = is_same<_Iter, typename _Iter::_Prevent_inheriting_unwrap>::value;
^
exit status 1
Compilation error: 'unsigned int*' is not a class, struct, or union type
To reproduce
template<class, class>
structis_same {
staticconstexprbool value = false; // determine whether arguments are the same type
};
template<class_Ty>
structis_same<_Ty, _Ty> {
staticconstexprbool value = true;
};
template<class... _Types>
usingvoid_t = void;
template<class_Iter, class = void>
struct_Allow_inheriting_unwrap {
staticconstexprbool value = true;
};
template<class_Iter>
struct_Allow_inheriting_unwrap<_Iter, void_t<typename _Iter::_Prevent_inheriting_unwrap>> {
staticconstexprbool value = is_same<_Iter, typename _Iter::_Prevent_inheriting_unwrap>::value;
};
voidsetup() {
constexprauto BB = _Allow_inheriting_unwrap<unsignedint*, void>::value;
}
voidloop() {
// put your main code here, to run repeatedly:
}
Expected behavior
This code can be compiled in both MSVC and Godbolt. Even in the Arduino IDE, the value of constexpr auto BB is correctly displayed as bool true. But once it enters the compile phase, the compiler mistakenly tries to match the specialized _Allow_inheriting_unwrap and then fails because unsigned int * has no members to reference.
Arduino CLI version
0.35.2
Operating system
Windows
Operating system version
Windows 11
Additional context
This issue only appears on the Arduino Due SAM platform. The AVR platform is normal.
Describe the problem
To reproduce
Expected behavior
This code can be compiled in both MSVC and Godbolt. Even in the Arduino IDE, the value of
constexpr auto BB
is correctly displayed asbool true
. But once it enters the compile phase, the compiler mistakenly tries to match the specialized_Allow_inheriting_unwrap
and then fails becauseunsigned int *
has no members to reference.Arduino CLI version
0.35.2
Operating system
Windows
Operating system version
Windows 11
Additional context
This issue only appears on the Arduino Due SAM platform. The AVR platform is normal.
Issue checklist
The text was updated successfully, but these errors were encountered: