Closed Bug 1166251 Opened 9 years ago Closed 9 years ago

Compiler error: ./NodeListBinding.cpp:32:15: error: no matching function for call to 'StrongOrRawPtr'

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1165184

People

(Reporter: mtseng, Unassigned)

References

Details

In bug 1155493, I added a new webidl file which named "CaretStateChangedEvent.webidl". After added this file, I hit this compiler error today. Detailed log as following:

 0:21.48 In file included from /Users/Morris/mozilla/gecko-dev/obj-x86_64-apple-darwin14.3.0/dom/bindings/UnifiedBindings13.cpp:2:
 0:21.48 ./NodeListBinding.cpp:32:15: error: no matching function for call to 'StrongOrRawPtr'
 0:21.48   auto result(StrongOrRawPtr<nsINode>(self->Item(arg0)));
 0:21.48               ^~~~~~~~~~~~~~~~~~~~~~~
 0:21.48 ../../dist/include/mozilla/dom/BindingUtils.h:3219:1: note: candidate function [with T = nsINode, ReturnType = nsINode *] not viable: cannot convert argument of incomplete type 'nsIContent *' to 'nsINode *'

I think this is because NodeListBinding.cpp didn't include "nsIContent.h". I added "nsIContent.h" in the NodeListBinding.cpp manually and everything is ok. There was other file in the UnifiedBinding#.cpp would include nsIContent.h so we didn't hit this compiler error before I adding CaretStateChangedEvent.webidl.

I think the solution is NodeListBinding.cpp should include nsIContent.h. Since NodeListBinding.cpp is generated by Codegen.py.

Codegen will found suitable headers when generating source. But in the NodeList case, NodeList.webidl doesn't use any stuff which is related to nsIContent. So NodeListBinding.cpp only includes "nsINode.h" but not "nsIContent.h".

:peterv, do you have any direction to solve this issue? Thanks.
Flags: needinfo?(peterv)
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(peterv)
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.