Closed Bug 1028428 Opened 10 years ago Closed 10 years ago

clang++ -stdlib=libc++ build fails: ipc/glue/SharedMemory.h:87:3: error: static_assert failed "This class has no public destructor. That's good! So please remove the HasDangerousPublicDestructor specialization for it."

Categories

(Core :: General, defect)

All
FreeBSD
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: jbeich, Assigned: bjacob)

References

Details

FreeBSD 10.0 uses libc++ by default which defaults to std::is_destructible. Could it be no other TBPL platform uses recent enough compiler and ends up with the error as well?

In file included from xpcom/io/Unified_cpp_xpcom_io0.cpp:145:
In file included from xpcom/io/nsMultiplexInputStream.cpp:24:
In file included from dist/include/mozilla/ipc/InputStreamUtils.h:8:
In file included from ipc/ipdl/_ipdlheaders/mozilla/ipc/InputStreamParams.h:17:
In file included from dist/include/mozilla/ipc/ProtocolUtils.h:20:
In file included from dist/include/mozilla/ipc/Shmem.h:20:
dist/include/mozilla/ipc/SharedMemory.h:87:3: error: static_assert failed
      "This class has no public destructor. That's good! So please remove the
      HasDangerousPublicDestructor specialization for it."
  NS_INLINE_DECL_REFCOUNTING(SharedMemory)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dist/include/nsISupportsImpl.h:489:5: note: expanded from macro
      'NS_INLINE_DECL_REFCOUNTING'
    MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(_class)                                \
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dist/include/nsISupportsImpl.h:472:3: note: expanded from macro
      'MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING'
  static_assert(!mozilla::HasDangerousPublicDestructor<X>::value || \
  ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

http://buildbot.rhaalovely.net/builders/mozilla-central-freebsd-amd64/builds/345/steps/build/logs/stdio
MOZ_CAN_USE_IS_DESTRUCTIBLE_FALLBACK works fine
(In reply to Jan Beich from comment #1)
> MOZ_CAN_USE_IS_DESTRUCTIBLE_FALLBACK works fine

Ah, thanks for checking that. That's good info: we want to use that fallback, then. Now, the std:: path is working fine for other people (like, it's what's on TBPL on Mac). Could you share your clang++ --version and your libc++ version and whatever other system info that could be relevant so we could think what would be an appropriate preprocessor check to decide when to use the fallback?
(In reply to Jan Beich from comment #0)
> FreeBSD 10.0 uses libc++ by default which defaults to std::is_destructible.
> Could it be no other TBPL platform uses recent enough compiler and ends up
> with the error as well?

The Mac slaves definitely use clang + libc++ so they must be useing the std:: path too and it's working for them.
I'm actually using FreeBSD 11.0-CURRENT with clang 3.4.1 and libc++-3.4. Both have a few fixes backported on top of releases.

TBPL builds on OS X 10.7 but only OS X 10.9 uses libc++ by default. For one, <type_traits> in libc++ predates SVN import in 2010-05-11.

https://tbpl.mozilla.org/php/getParsedLog.php?id=42203317&tree=Try
Ah, thanks! Let's use the fallback, then.
If you write the patch to just unconditionally use the fallback on clang++, I will happily review it :-)
I just went ahead and landed it without review since it's a simple bustage fix:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5948b714c174
Assignee: nobody → bjacob
Thanks. mozilla-inbound builds fine now. I've also tested clang-3.4.1 + libstdc++-4.8.4 and std::is_destructible works fine there. Maybe a libc++ bug.
next buildbot run after it's merged to m-c will also check it's okay now. Thanks jan :)
https://hg.mozilla.org/mozilla-central/rev/5948b714c174
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Depends on: 1256136
You need to log in before you can comment on or make changes to this bug.