Open jimaobian opened 7 years ago
Hi @jimaobian, can we have a bit more information please? like, for example, 1) what is the expected outcome of your sketch above, and 2) what exactly is "the problem" (what goes wrong) ?
Hi @eriknyquist Of course.
It seems that the compiler or the linker is not properly worked in this situation.
Bug confirmed, the sketch works as expected on any other architecture (AVR, SAMD)
Thanks @facchinm and @jimaobian
Assigning to @calvinatintel and @SidLeung to investigate as toolchain issue
I'm not sure this is really a good example of a singleton design pattern. I think the issue may be related to the newer C++ standards vs the older ones and the enforcement of publicly declared constructors. (have to think about what's going on here...)
Still trying to figure out what's wrong here-- I had hoped it was symptom of a bug that was fixed here https://github.com/01org/corelibs-arduino101/commit/d6c68f26914bf9508e8b76081d383a5cd432c7b6, but unfortunately not. I should be able to work on this some more next week, I'll post any new information here
Hi. When we try to use singleton, inherit and customized constructor at the same time this problem will occur. Please see the following example. You can comment the customized constructor to eliminate this problem
OS: Tested on Windows and Mac. Arduino IDE: Version 1.6.13. Arduino 101 Board Manager: Version 1.0.7. Firmware updated.