|
Ublas : |
From: Michael Stevens (mail_at_[hidden])
Date: 2005-09-08 13:45:43
On Donnerstag 08 September 2005 20:44, Michael Stevens wrote:
> On Donnerstag 08 September 2005 20:44, Michael Stevens wrote:
> > On Donnerstag 08 September 2005 20:43, Michael Stevens wrote:
> > > On Donnerstag 08 September 2005 02:13, Paul C. Leopardi wrote:
> > > > Hi Michael,
> > > > Have you tried with the latest snapshot of gcc 4.1 ?
> > >
> > > Not yet. I have been wading through the stuff related to DR214 (bug
> > > 19203). All rather heavy. Thanks for all the links.
> > >
> > > I have simplifed the test case which is effect by the changes. This
> > > should be a good basis to compare result or work on GCC bug reports..
> > >
> > > // Effect of DR214 FIX (Bug 19203) on 2 simple function template cases
> > >
> > > template <class E>
> > > class expression {
> > > };
> > >
> > > // ef - deduction of E is via expression
> > > template<class E>
> > > void ef (expression<E> e);
> > > template<class R, class E>
> > > void ef (expression<E> e);
> > >
> > > // sf - deduction of S is simple
> > > template<class S>
> > > void sf (S s);
> > > template<class R, class S>
> > > void sf (S s);
> > >
> > > void test()
> > > {
> > > expression<int> a;
> > > ef (a); // ok
> > > ef<char> (a); // ok
> > > ef<int> (a); // Ambiguous in 4.0.1 when R == E
> > >
> > > sf (a); // ok
> > > sf<char> (a); // ok
> > > sf<int> (a); // unambiguous
> > > }
> > >
> > > For comparision intel-8.1 finds no ambiguities, vc-7.1 behaves as
> > > gcc-4.0.1
> > >
> > > The result of the change is rather ogly. I believe there is nothing
> > > fundementaly different in deducing the two forms of template parameters
> > > expression<E>
> > > OR
> > > S
> > >
> > > Yet in the former case an ambiguity is possible and in the latter not!!
> > > I don't see anything in DR214 that the two cases should be different.
> > >
> > > All the best,
> > > Michael
> > >
> > > > PR 23513 may also be related. See
> > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23513
> > > >
> > > > The change we are seeing may be related to C++ Standard Core Language
> > > > Issue 402. See
> > > > http://gcc.gnu.org/ml/gcc-patches/2005-03/msg02862.html and
> > > > http://www.open-std.org/jtc1/sc22/WG21/docs/cwg_active.html
> > > >
> > > > 402. More on partial ordering of function templates
> > > > Section: 14.5.5.2 temp.func.order
> > > > Status: open
> > > > Submitter: Nathan Sidwell
> > > > Date: 7 Apr 2003
> > > >
> > > > I've tried with a few different versions and snapshots, with
> > > > results:
> > > >
> > > > With gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)
> > > > your simple case compiles OK.
> > > >
> > > > Each of
> > > > gcc version 4.0.1
> > > > gcc version 4.0.2 20050825 (prerelease)
> > > > gcc version 4.1.0 20050813 (experimental)
> > > > gives an error message about an ambiguity:
> > >
> > > The latter probably has the FIX to bug 21799 in (dated 20050812) so I
> > > assume this does not change anything for our situation.
> > >
> > > > Best regards, Paul Leopardi
-- ___________________________________ Michael Stevens Systems Engineering 34128 Kassel, Germany Phone/Fax: +49 561 5218038 Navigation Systems, Estimation and Bayesian Filtering http://bayesclasses.sf.net ___________________________________