Rename test warning suppressions when using clang

Suppresses:
warning: conversion function converting 'Space::ABC' to itself will never be used
This commit is contained in:
William S Fulton 2015-02-03 08:02:35 +00:00
commit 29127cf014
2 changed files with 26 additions and 0 deletions

View file

@ -31,13 +31,27 @@ namespace Space {
};
}
#if defined(SWIG)
%exception Space::ABC::operator ABC %{
#if defined(__clang__)
// Workaround for: warning: conversion function converting 'Space::ABC' to itself will never be used
result = *arg1;
#else
$action
#endif
%}
#endif
namespace Space {
// non-templated class using itself in method and operator
class ABC {
public:
void method(ABC a) const {}
void method(Klass k) const {}
#if !defined(__clang__)
// Workaround for: warning: conversion function converting 'Space::ABC' to itself will never be used
operator ABC() const { ABC a; return a; }
#endif
operator Klass() const { Klass k; return k; }
};
}

View file

@ -78,6 +78,15 @@ namespace Space {
};
}
%exception Space::ABC::operator ABC %{
#if defined(__clang__)
// Workaround for: warning: conversion function converting 'Space::ABC' to itself will never be used
result = *arg1;
#else
$action
#endif
%}
namespace Space {
// non-templated class using itself in method and operator
class ABC {
@ -90,7 +99,10 @@ class ABC {
void method(ABC a) const {}
void method(Klass k) const {}
#if !defined(__clang__)
// Workaround for: warning: conversion function converting 'Space::ABC' to itself will never be used
operator ABC() const { ABC a; return a; }
#endif
operator Klass() const { Klass k; return k; }
};
}