Skip to content

Commit

Permalink
Merge pull request #827 from ericniebler/workaround_126
Browse files Browse the repository at this point in the history
Force failure for begin/end on volatile initializer_list
  • Loading branch information
ericniebler authored May 14, 2018
2 parents 916fb88 + 2ea3202 commit 77a5469
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions include/range/v3/begin_end.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ namespace ranges
template<typename T>
void begin(T const &) = delete;

#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 8
// Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85765
template<typename T>
void begin(std::initializer_list<T> volatile &) = delete;
template<typename T>
void begin(std::initializer_list<T> const volatile &) = delete;
#endif

struct fn
{
private:
Expand Down Expand Up @@ -120,6 +128,14 @@ namespace ranges
template<typename T>
void end(T const &) = delete;

#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 8
// Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85765
template<typename T>
void end(std::initializer_list<T> volatile &) = delete;
template<typename T>
void end(std::initializer_list<T> const volatile &) = delete;
#endif

struct fn
{
private:
Expand Down

0 comments on commit 77a5469

Please sign in to comment.