[PATCH] Fix compilation error in DiveComputerList destructor on MacOSX

Tomaz Canabrava tcanabrava at kde.org
Tue Jun 18 06:09:34 PDT 2013


MacOS uses clang by default nowdays, I think that may have something to do with.

On Tue, Jun 18, 2013 at 9:29 AM,  <subsurface at henrik.synth.no> wrote:
> From: Henrik Brautaset Aronsen <subsurface at henrik.synth.no>
>
> The compiler on MacOSX seems stricter than others:
>
> qthelper.cpp: In destructor ‘DiveComputerList::~DiveComputerList()’:
> qthelper.cpp:10: error: expected class-name before ‘(’ token
>
> Fixed with help from http://stackoverflow.com/a/14777627/13365
>
> Signed-off-by: Henrik Brautaset Aronsen <subsurface at henrik.synth.no>
> ---
>
>
> We don't need that destructor according to Tomaz and
> http://stackoverflow.com/a/14777627/13365.  If we still want to
> keep it, the MacOSX compiler would have been happy with
>
>         dcMap.~QMap<QString, DiveComputerNode>();
>
> instead.
>
> Anyway, this is yet another occurance of the MacOSX compiler being
> more strict than others.  Is there a way to figure out why this is
> so?  Then we could either introduce this strictness to other
> platforms, or calm down MacOSX.
>
> Henrik
>
>
>
>  qthelper.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/qthelper.cpp b/qthelper.cpp
> index 9c74a74..2384a31 100644
> --- a/qthelper.cpp
> +++ b/qthelper.cpp
> @@ -1,4 +1,5 @@
>  #include "qthelper.h"
> +#include <QMap>
>
>  DiveComputerList::DiveComputerList()
>  {
> @@ -7,7 +8,7 @@ DiveComputerList::DiveComputerList()
>
>  DiveComputerList::~DiveComputerList()
>  {
> -       dcMap.~QMap();
> +
>  }
>
>  bool DiveComputerNode::operator == (const DiveComputerNode &a) const {
> --
> 1.8.2.2
>
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


More information about the subsurface mailing list