On Mon, Jan 23, 2012 at 7:45 PM, Richard Smith <[email protected]> wrote: > Looks good to me.
Thanks - committed as r148787. > (Unrelated to your change...) while looking at your [stmt.ambig]p1 test, I > noticed that we appear to disambiguate > > T(x)()->m; > > as an expression, when T and m are both types. I'm not sure that's right: it's > not clear whether the "purely syntactic" disambiguation covers the "T must be > 'auto'" rule or not. > > FWIW, recent g++ rejects the above (it says: function with trailing return > type not declared with 'auto' type specifier). Interesting... I assume we get the 'auto' case correct & I'm inclined to think that's legitimate (sure, it's convenient because it means we don't have to do anything). 'auto' does syntactically disambiguate the expression (& quite easily, since it appears at the start) no name resolution, etc, required. I know someone mentioned that a possible future expansion to 'auto' might be 'auto' in sub-parts of a declaration (eg: std::vector<auto>::iterator = v.begin()) - in that case I don't know if this would qualify as ambiguous since the auto declaration version would need an assignment (I don't know if that can be factored into the disambiguation). Also - can you use late bound return types in function pointer declarations? I suppose it might be possible. "auto (*x)(int) -> float = func;" ? - David > > - Richard > > On Sat, January 21, 2012 09:48, David Blaikie wrote: >> Bump... another really small patch. >> >> >> On Mon, Jan 9, 2012 at 11:17 PM, David Blaikie <[email protected]> wrote: >> >>> 3rd time's the charm... sorry for the noise. >>> >>> >>> On Mon, Jan 9, 2012 at 11:14 PM, David Blaikie <[email protected]> wrote: >>> >>>> Oops - updated test (removed some previously expected warnings that >>>> don't fire any more since we've got some of the uniform initialization >>>> stuff working now) >>>> >>>> On Mon, Jan 9, 2012 at 10:23 PM, David Blaikie <[email protected]> >>>> wrote: >>>> >>>>> Bump (patch resync'd to recent revision) >>>>> >>>>> >>>>> On Tue, Dec 13, 2011 at 4:12 PM, David Blaikie <[email protected]> >>>>> wrote: >>>>> >>>>>> & of course I forgot to include the patch... here we go. >>>>>> >>>>>> >>>>>> On Tue, Dec 13, 2011 at 4:11 PM, David Blaikie <[email protected]> >>>>>> wrote: >>>>>> >>>>>>> This patch adds support for decltype in simple-type-specifiers such >>>>>>> as: >>>>>>> >>>>>>> >>>>>>> struct foo { foo(int); }; foo func() { return decltype(foo())(3); >>>>>>> } >>>>>>> >>>>>>> >>>>>>> I'm not sure how much testing would be desired here - I could go >>>>>>> through the spec & find all the uses of simple-type-specifier & add >>>>>>> test cases that verify that decltype works in such contexts but for >>>>>>> now I've done a smattering of those cases & things seem to be >>>>>>> working fairly nicely. >>>>>>> >>>>>>> Let me know if this is suitable, >>>>>>> - David >>>>>>> >> > _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
