This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51194] ICE about template aliasing
- From: "dodji at seketeli dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 17 Nov 2011 17:33:28 +0000
- Subject: [Bug c++/51194] ICE about template aliasing
- Auto-submitted: auto-generated
- References: <bug-51194-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51194
--- Comment #1 from dodji at seketeli dot org <dodji at seketeli dot org> 2011-11-17 17:33:28 UTC ---
I could not reproduce the ICE with svn trunk revision r181378. Here is
what I get:
$ cat -n test.cc
1 #include <boost/mpl/and.hpp>
2 #include <boost/type_traits/is_same.hpp>
3
4 template < bool, class T = void >
5 enable_if_c
6 {
7 typedef T type;
8 };
9 template < class T >
10 enable_if_c<false, T>
11 { };
12
13 template < class Cond, class T = void >
14 using enable_if = enable_if_c<Cond::value, T>;
15
16 template < template <class...> class... Conds >
17 struct condition_and
18 {
19 template < class... Types >
20 using enable = enable_if<boost::mpl::and_<Conds<Types>...>>;
21 };
22
23 template < class T, class U = T >
24 using Test = typename condition_and
25 <
26 // For any two parameters meta-functions, same error occurs.
27 boost::is_same
28 , boost::is_same
29 , boost::is_same
30 >::template enable<T, U>; // here
$ g++ -std=c++0x test.cc
test.cc:5:1: erreur: âenable_if_câ does not name a type
test.cc:10:1: erreur: âenable_if_câ does not name a type
test.cc:14:19: erreur: expected type-specifier before âenable_if_câ
test.cc:14:19: erreur: expected â;â before âenable_if_câ
test.cc:14:19: erreur: âenable_if_câ does not name a type
test.cc:14:19: erreur: mismatched argument pack lengths while expanding
âConds<Types>â
$
Note that the code is not valid.
If you are still getting an ICE, please provide the pre-processed output
(using the option -save-temps, for instance) so that I can be sure to
use a similar environment as the one you used.
Thanks.