Closed
Bug 748237
Opened 13 years ago
Closed 13 years ago
It's not possible to include a header using jshashtable from any dir that uses FAIL_ON_WARNINGS=1 due to android bustage in MoveRef
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla15
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
Background: Android builds in c++11 mode. So this code in MoveRef gets compiled:
operator T&& () const { return static_cast<T&&>(*pointer); }
which leads to this lovely warning:
../../../dist/include/js/Utility.h:860: warning: returning reference to temporary
and in particular it happens due to this chain of template instantiations:
../../../dist/include/js/Utility.h: In member function 'js::MoveRef<T>::operator T&&() const [with T = JSObject*]':
../../../dist/include/js/HashTable.h:916: instantiated from 'void js::HashMapEntry....
../../../dist/include/js/HashTable.h:84: instantiated from 'void js::detail::HashTableEntry<T>::operator=(js::MoveRef<js::detail::HashTableEntry<T> >)
../../../dist/include/js/HashTable.h:595: instantiated from 'bool js::detail::HashTable<T, HashPolicy, AllocPolicy>::changeTableSize(int)
../../../dist/include/js/HashTable.h:635: instantiated from 'bool js::detail::HashTable<T, HashPolicy, AllocPolicy>::checkOverloaded()
../../../dist/include/js/HashTable.h:263: instantiated from 'js::detail::HashTable<T, HashPolicy, AllocPolicy>::Enum::~Enum()
/builds/slave/try-andrd-xul/build/js/xpconnect/wrappers/../src/XPCMaps.h:752: instantiated from here
Sadly, XPCMaps.h is includes by xpcprivate.h, which is included by XPCQuickStubs.h, which is included by the new-binding Utils.h. So trying to use new-bindings in any dir that has FAIL_ON_WARNINGS makes it fail on Android.
That said, the warning here sounds pretty bad. Is it really meant to be happening?
Assignee | ||
Comment 1•13 years ago
|
||
This compiles locally for me with clang and passes a try push on Android
Assignee | ||
Updated•13 years ago
|
Whiteboard: [need review]
Assignee | ||
Updated•13 years ago
|
Attachment #618462 -
Flags: review?(luke)
Assignee | ||
Updated•13 years ago
|
Assignee: general → bzbarsky
Comment 2•13 years ago
|
||
Comment on attachment 618462 [details] [diff] [review]
Only do the c++11 stuff for clang here, since otherwise we get scary warnings with gcc on android.
Right on.
Attachment #618462 -
Flags: review?(luke) → review+
Assignee | ||
Comment 3•13 years ago
|
||
Flags: in-testsuite-
Whiteboard: [need review]
Target Milestone: --- → mozilla15
Comment 4•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•