Last Comment Bug 692782 - Bug 690670 broke clang builds
: Bug 690670 broke clang builds
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: mozilla10
Assigned To: :Ehsan Akhgari
:
: Nathan Froyd [:froydnj]
Mentors:
Depends on:
Blocks: clang 690670
  Show dependency treegraph
 
Reported: 2011-10-07 07:43 PDT by :Ehsan Akhgari
Modified: 2011-10-09 07:31 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (v1) (1.95 KB, patch)
2011-10-07 07:58 PDT, :Ehsan Akhgari
cjones.bugs: review+
Details | Diff | Splinter Review

Description :Ehsan Akhgari 2011-10-07 07:43:43 PDT
In file included from /Users/ehsanakhgari/moz/mozilla-central/hal/sandbox/SandboxHal.cpp:1:
In file included from /Users/ehsanakhgari/moz/mozilla-central/hal/sandbox/SandboxHal.cpp:41:
In file included from /Users/ehsanakhgari/moz/mozilla-central/hal/Hal.h:45:
../dist/include/nsTArray.h:1338:5: error: use of undeclared identifier 'AppendElements'
    AppendElements(other);
    ^
In file included from /Users/ehsanakhgari/moz/mozilla-central/hal/sandbox/SandboxHal.cpp:1:
/Users/ehsanakhgari/moz/mozilla-central/hal/sandbox/SandboxHal.cpp:65:35: note: in instantiation of function template specialization 'AutoInfallibleTArray<unsigned
      int, 8>::AutoInfallibleTArray<nsTArrayDefaultAllocator>' requested here
  AutoInfallibleTArray<uint32, 8> p(pattern);
                                  ^
In file included from /Users/ehsanakhgari/moz/mozilla-central/hal/sandbox/SandboxHal.cpp:1:
In file included from /Users/ehsanakhgari/moz/mozilla-central/hal/sandbox/SandboxHal.cpp:41:
In file included from /Users/ehsanakhgari/moz/mozilla-central/hal/Hal.h:45:
../dist/include/nsTArray.h:824:14: note: must qualify identifier to find this declaration in dependent base class
  elem_type *AppendElements(const Item* array, size_type arrayLen) {
             ^
../dist/include/nsTArray.h:835:14: note: must qualify identifier to find this declaration in dependent base class
  elem_type *AppendElements(const nsTArray<Item, Allocator>& array) {
             ^
../dist/include/nsTArray.h:848:14: note: must qualify identifier to find this declaration in dependent base class
  elem_type *AppendElements(size_type count) {
             ^
2 warnings and 1 error generated.
Comment 1 :Ehsan Akhgari 2011-10-07 07:58:04 PDT
Created attachment 565535 [details] [diff] [review]
Patch (v1)
Comment 2 Nathan Froyd [:froydnj] 2011-10-07 10:01:00 PDT
FWIW, this patch is also required to build with not-yet-released GCC 4.7, where you get something like:

In file included from /home/froydnj/src/mozilla-central/hal/Hal.h:45:0,
                 from /home/froydnj/src/mozilla-central/hal/sandbox/SandboxHal.cpp:40:
../dist/include/nsTArray.h: In instantiation of 'AutoInfallibleTArray<E, N>::AutoInfallibleTArray(const nsTArray<E, Allocator>&) [with Allocator = nsTArrayDefaultAllocator; E = unsigned int; unsigned int N = 8u]':
/home/froydnj/src/mozilla-central/hal/sandbox/SandboxHal.cpp:65:44:   required from here
../dist/include/nsTArray.h:1315:5: error: 'AppendElements' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../dist/include/nsTArray.h:1315:5: note: declarations in dependent base 'nsTArray<unsigned int, nsTArrayInfallibleAllocator>' are not found by unqualified lookup
../dist/include/nsTArray.h:1315:5: note: use 'this->AppendElements' instead

I can verify that this bug is fixed with the provided patch.
Comment 3 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2011-10-07 12:02:52 PDT
Comment on attachment 565535 [details] [diff] [review]
Patch (v1)

Nit: would you please add

> template<class E, PRUint32 N, class Alloc=nsTArrayDefaultAllocator>
> class nsAutoTArray : public nsAutoArrayBase<nsTArray<E, Alloc>, N>
> {

typedef nsAutoArrayBase<nsTArray<E, Alloc>, N> Base;

> public:
>   nsAutoTArray() {}
> 
>   template<typename Allocator>
>   nsAutoTArray(const nsTArray<E, Allocator>& other) {
>-    AppendElements(other);

and then call

>+    Base::AppendElements(other);

instead?  And below.

r=me with that.
Comment 5 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-10-09 07:31:02 PDT
https://hg.mozilla.org/mozilla-central/rev/500185b5808c

Note You need to log in before you can comment on or make changes to this bug.