← Back to team overview

hugin-devs team mailing list archive

[Bug 1213586] Re: friend class Notify::self_type; doesn't work with clang

 

I think it works for me (I say "I think" because I'm still unable to
compile hugin due to problems with boost, but I believe compilation went
past that point). I cannot comment on whether it works for other
compilers.

Just a side note. Some commented that 'friend typename' was not valid in standards prior to C++11. So another option would be to use
    #if __cplusplus >= 201103L
in some way.

-- 
You received this bug notification because you are a member of Hugin
Developers, which is subscribed to Hugin.
https://bugs.launchpad.net/bugs/1213586

Title:
  friend class Notify::self_type; doesn't work with clang

Status in Hugin - Panorama Tools GUI:
  Fix Committed

Bug description:
  I tried to compile hugin 2012.0.0 (but sources of the latest version
  are still the same) on Mac OS X 10.7 with Xcode 4.6.3 and clang (Apple
  LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)). One of the
  problems is with the file src/foreign/vigra/vigra/cachedfileimage.hxx
  and the following chunk of code:

   class NotifyingDirectionSelector<UnstridedArrayTag, T, Notify>
   {
   #ifdef __GNUC__
   friend class Notify::self_type;
   #else
   friend typename Notify::self_type;
   #endif

  The compiler entered the first part of #ifdef and refused to compile
  "friend class Notify::self_type;". The other code (friend typename
  Notify::self_type;) was happily accepted, but I'm not sure what the
  proper patch should be / how to modify "#ifdef __GNUC__" to redirect
  clang to the #else part.

To manage notifications about this bug go to:
https://bugs.launchpad.net/hugin/+bug/1213586/+subscriptions


References