Last Comment Bug 771048 - cannot instanciate nsAutoRef<T>::swap()
: cannot instanciate nsAutoRef<T>::swap()
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla16
Assigned To: Vicamo Yang [:vicamo][:vyang]
:
: Nathan Froyd [:froydnj]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-04 22:52 PDT by Vicamo Yang [:vicamo][:vyang]
Modified: 2012-07-09 18:04 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v0 (2.27 KB, patch)
2012-07-04 23:07 PDT, Vicamo Yang [:vicamo][:vyang]
khuey: review-
Details | Diff | Splinter Review
v1 (2.69 KB, patch)
2012-07-09 03:26 PDT, Vicamo Yang [:vicamo][:vyang]
khuey: review+
Details | Diff | Splinter Review
v2 (3.00 KB, patch)
2012-07-09 09:23 PDT, Vicamo Yang [:vicamo][:vyang]
vicamo: review+
Details | Diff | Splinter Review

Description Vicamo Yang [:vicamo][:vyang] 2012-07-04 22:52:09 PDT
struct A {};

  template <>
  class nsAutoRefTraits<A>
    : public nsPointerRefTraits<A>
  {
  public:
    static void Release(A *ptr) {}
    static void AddRef(A *ptr) {}
  };

  nsCountedRef<A> a, b;
  a.swap(b);

Code above generates compile time error:

  ../../dist/include/nsAutoRef.h:189: error: no matching function for call to 'nsAutoRefBase<TestObjectA>::LocalSimpleRef::operator=(nsAutoRef<TestObjectA>* const)'
  ../../dist/include/nsAutoRef.h:491: note: candidates are: nsSimpleRef<TestObjectA>& nsSimpleRef<TestObjectA>::operator=(const nsSimpleRef<TestObjectA>&)
Comment 1 Vicamo Yang [:vicamo][:vyang] 2012-07-04 23:07:24 PDT
Created attachment 639229 [details] [diff] [review]
v0
Comment 2 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-07-05 09:56:14 PDT
Comment on attachment 639229 [details] [diff] [review]
v0

Review of attachment 639229 [details] [diff] [review]:
-----------------------------------------------------------------

The change to nsAutoRef.h is fine, but your test is not.  You need to use the passed/fail functions from http://mxr.mozilla.org/mozilla-central/source/xpcom/tests/TestHarness.h to get your test to work properly on our build machines.
Comment 3 Vicamo Yang [:vicamo][:vyang] 2012-07-08 20:24:42 PDT
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #2)
> Comment on attachment 639229 [details] [diff] [review]
> v0
> 
> Review of attachment 639229 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> The change to nsAutoRef.h is fine, but your test is not.  You need to use
> the passed/fail functions from
> http://mxr.mozilla.org/mozilla-central/source/xpcom/tests/TestHarness.h to
> get your test to work properly on our build machines.

Thank you. I'll check what should I do then.
Comment 4 Mozilla RelEng Bot 2012-07-09 02:45:24 PDT
Try run for c1a427dbcd07 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=c1a427dbcd07
Results (out of 217 total builds):
    success: 196
    warnings: 16
    failure: 5
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/vyang@mozilla.com-c1a427dbcd07
Comment 5 Vicamo Yang [:vicamo][:vyang] 2012-07-09 03:26:58 PDT
Created attachment 640175 [details] [diff] [review]
v1
Comment 6 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-07-09 07:40:54 PDT
Comment on attachment 640175 [details] [diff] [review]
v1

Review of attachment 640175 [details] [diff] [review]:
-----------------------------------------------------------------

Please add a license header to TestAutoRef.cpp

r=me
Comment 7 Vicamo Yang [:vicamo][:vyang] 2012-07-09 09:23:00 PDT
Created attachment 640245 [details] [diff] [review]
v2

Address review comment #6. Thanks, Kyle.
Comment 8 Vicamo Yang [:vicamo][:vyang] 2012-07-09 09:26:05 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/84623518d428
Comment 9 Ryan VanderMeulen [:RyanVM] 2012-07-09 18:04:04 PDT
https://hg.mozilla.org/mozilla-central/rev/84623518d428

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