[Bug c++/43559] New: Overloaded template functions became ambiguous

2010-03-28 Thread sefi at s-e-f-i dot de
The following code used to work with gcc-4.4.3.
The Comeau online compiler also accepts it.
But with the gcc-4.5 trunk, it is rejected as ambiguous.


template void f(U&) { }
template void f(T const&) { }

int main()
{
int a;
f(a);
}

This is a reduced test case from boost.phoenix.
I'm not completely sure if gcc-4.5 is now right or wrong. Please investigate.


-- 
   Summary: Overloaded template functions became ambiguous
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: sefi at s-e-f-i dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43559



[Bug c++/43608] New: Boost.MPL code doesn't get the placeholders substituted anymore

2010-03-31 Thread sefi at s-e-f-i dot de
The following code stopped working with gcc-4.5.
gcc-4.4.3 and clang both accept it.
On gcc-4.5, boost::mpl_::arg<2> is passed to metafunction instead of test1.
The strange thing is: If the specialization of metafunction<_2> is provided,
the code works again.
I'm sorry that this is not a minimal test case, because I don't know how to get
rid of the MPL parts.


#include 
#include 
#include 
#include 
#include 

struct test1
{
typedef int inner_type;
};

template<
typename Foo
>
struct metafunction
{
typedef typename Foo::inner_type type;
};

#if 0
template<>
struct metafunction<
boost::mpl::_2
>;
#endif

int main()
{
typedef boost::mpl::fold<
boost::mpl::vector1<
test1
>,
boost::mpl::vector0<>,
boost::mpl::push_back<
boost::mpl::_1,
metafunction<
boost::mpl::_2
>
>
>::type transformed;

boost::mpl::at_c::type i = 42;
}


-- 
   Summary: Boost.MPL code doesn't get the placeholders substituted
anymore
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sefi at s-e-f-i dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43608



[Bug c++/43608] Boost.MPL code doesn't get the placeholders substituted anymore

2010-04-01 Thread sefi at s-e-f-i dot de


--- Comment #7 from sefi at s-e-f-i dot de  2010-04-01 15:21 ---
Thank you all very much. Explicitly scoping arity_helper indeed fixes the
issue.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43608