The default bug view has changed. See this FAQ.

Bug 690670 broke clang builds

RESOLVED FIXED in mozilla10

Status

()

Core
XPCOM
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

Trunk
mozilla10
x86
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
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.
(Assignee)

Comment 1

6 years ago
Created attachment 565535 [details] [diff] [review]
Patch (v1)
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #565535 - Flags: review?(jones.chris.g)
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 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.
Attachment #565535 - Flags: review?(jones.chris.g) → review+
(Assignee)

Comment 4

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/500185b5808c
Target Milestone: --- → mozilla10
https://hg.mozilla.org/mozilla-central/rev/500185b5808c
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.