This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52224] [C++0x] Generic operator gets pulled into compile-time expression
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 13 Feb 2012 09:26:34 +0000
- Subject: [Bug c++/52224] [C++0x] Generic operator gets pulled into compile-time expression
- Auto-submitted: auto-generated
- References: <bug-52224-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52224
--- Comment #2 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2012-02-13 09:26:34 UTC ---
I condensed the test case further down to the following:
//---
template<bool, class> struct enable_if {};
template<class T> struct enable_if<true, T> { typedef T type; };
template <typename T> struct is_mine { enum { value = false }; };
template <typename E1, typename E2>
struct either_is_mine { static const bool value = is_mine<E1>::value ||
is_mine<E2>::value; };
template <typename E1, typename E2>
typename enable_if<either_is_mine<E1, E2>::value, int>::type
operator||(E1 e1, E2 e2);
template <typename E1, typename E2>
typename enable_if<either_is_mine<E1, E2>::value, int>::type
test(E1 e1, E2 e2);
const int n = sizeof(test(1, 2));
//---