Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Commit 24d2e73

Browse files
committed
Eliminate further -Wunused-local-typedef warnings from gcc 4.8
1 parent de4158f commit 24d2e73

File tree

7 files changed

+9
-11
lines changed

7 files changed

+9
-11
lines changed

thrust/detail/static_assert.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,16 @@ template<typename, bool x>
6464

6565
} // end thrust
6666

67-
#define THRUST_STATIC_ASSERT( B ) \
67+
#if (THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_GCC) && (THRUST_GCC_VERSION >= 40800)
68+
// gcc 4.8+ will complain about this typedef being unused unless we annotate it as such
69+
# define THRUST_STATIC_ASSERT( B ) \
70+
typedef ::thrust::detail::static_assert_test<\
71+
sizeof(::thrust::detail::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\
72+
THRUST_JOIN(thrust_static_assert_typedef_, __LINE__) __attribute__((unused))
73+
#else
74+
# define THRUST_STATIC_ASSERT( B ) \
6875
typedef ::thrust::detail::static_assert_test<\
6976
sizeof(::thrust::detail::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\
7077
THRUST_JOIN(thrust_static_assert_typedef_, __LINE__)
78+
#endif // gcc 4.8+
7179

thrust/system/cuda/detail/copy_if.inl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ struct copy_if_intervals_closure
6969
__device__ __thrust_forceinline__
7070
void operator()(void)
7171
{
72-
typedef typename thrust::iterator_value<OutputIterator>::type OutputType;
73-
7472
typedef unsigned int PredicateType;
7573

7674
const unsigned int CTA_SIZE = context_type::ThreadsPerBlock::value;
@@ -166,7 +164,6 @@ template<typename DerivedPolicy,
166164
Predicate pred)
167165
{
168166
typedef typename thrust::iterator_difference<InputIterator1>::type IndexType;
169-
typedef typename thrust::iterator_value<OutputIterator>::type OutputType;
170167

171168
if (first == last)
172169
return output;

thrust/system/cuda/detail/reduce_by_key.inl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,6 @@ struct reduce_by_key_closure
415415
__device__ __thrust_forceinline__
416416
void operator()(void)
417417
{
418-
typedef typename thrust::iterator_value<InputIterator1>::type KeyType;
419418
typedef typename thrust::iterator_value<ValueIterator>::type ValueType;
420419
typedef typename Decomposition::index_type IndexType;
421420
typedef typename thrust::iterator_value<FlagIterator>::type FlagType;
@@ -580,7 +579,6 @@ template <typename DerivedPolicy,
580579

581580
// temporary arrays
582581
typedef thrust::detail::temporary_array<IndexType,DerivedPolicy> IndexArray;
583-
typedef thrust::detail::temporary_array<KeyType,DerivedPolicy> KeyArray;
584582
typedef thrust::detail::temporary_array<ValueType,DerivedPolicy> ValueArray;
585583
typedef thrust::detail::temporary_array<bool,DerivedPolicy> BoolArray;
586584

thrust/system/detail/generic/count.inl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ template <typename DerivedPolicy, typename InputIterator, typename EqualityCompa
5050
typename thrust::iterator_traits<InputIterator>::difference_type
5151
count(thrust::execution_policy<DerivedPolicy> &exec, InputIterator first, InputIterator last, const EqualityComparable& value)
5252
{
53-
typedef typename thrust::iterator_traits<InputIterator>::value_type InputType;
54-
5553
// XXX use placeholder expression here
5654
return thrust::count_if(exec, first, last, thrust::detail::equal_to_value<EqualityComparable>(value));
5755
} // end count()

thrust/system/detail/generic/reduce_by_key.inl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ template<typename ExecutionPolicy,
8585
BinaryFunction binary_op)
8686
{
8787
typedef typename thrust::iterator_traits<InputIterator1>::difference_type difference_type;
88-
typedef typename thrust::iterator_traits<InputIterator1>::value_type KeyType;
8988

9089
typedef unsigned int FlagType; // TODO use difference_type
9190

thrust/system/detail/generic/replace.inl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ template<typename DerivedPolicy, typename InputIterator, typename OutputIterator
8484
Predicate pred,
8585
const T &new_value)
8686
{
87-
typedef typename thrust::iterator_traits<InputIterator>::value_type InputType;
8887
typedef typename thrust::iterator_traits<OutputIterator>::value_type OutputType;
8988

9089
detail::new_value_if<Predicate,T,OutputType> op(pred,new_value);

thrust/system/omp/detail/for_each.inl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ RandomAccessIterator for_each_n(execution_policy<DerivedPolicy> &,
5656
if (n <= 0) return first; //empty range
5757

5858
// create a wrapped function for f
59-
typedef typename thrust::iterator_reference<RandomAccessIterator>::type reference;
6059
thrust::detail::host_function<UnaryFunction,void> wrapped_f(f);
6160

6261
// do not attempt to compile the body of this function, which depends on #pragma omp,

0 commit comments

Comments
 (0)