[PATCH] [Bug c++/49118] fake template nesting for operator-> chain

David Krauss potswa@mac.com
Fri Jun 10 03:29:00 GMT 2011


On Jun 9, 2011, at 7:54 PM, Jason Merrill wrote:

> Looks good, just need ChangeLog and testcase now.
> 
> Jason

The changelog is the .clog attachment to previous.

I tried the testcase below but dejagnu seemed to hang with no compiler process running. I really don't know how to use dg, so perhaps there's an obvious error.

	- D

// { dg-do compile }

template< int n >
struct a { 
    a< n+1 >
	operator->()
	{ return a< n+1 >(); }
};

int main() {
    a<0>()->x; // { dg-error "instantiation depth exceeds maximum" }
}



More information about the Gcc-patches mailing list