[cfe-dev] Adding access to array size expressions in ConstantArrayType.

Douglas Gregor dgregor at apple.com
Wed Jul 1 09:37:17 PDT 2009

On Jun 30, 2009, at 12:52 PM, Enea Zaffanella wrote:

> While at it, we found a transient bug in revision 74387
> which is due to a double free of an Expr pointer.
> The testcase showing the bug, which has been extracted from
> test/SemaTemplate/temp_class_spec_neg.cpp, is as follows:
> ============
> template< int X, int (*array_ptr)[X] > class A2 {};
> int array[5];
> template< int X > class A2<X,&array> { };
> ============
> We report it because, as said above, it is a transient bug, showing  
> from
>  time to time. (We haven't checked if it has been already corrected in
> more recent revision.)

This is definitely a bug; there are a bunch of "Clone this  
expression!" FIXMEs within the template argument-handling code, where  
we end up sharing expressions then trying to delete them later. I've  
filed this as http://llvm.org/bugs/show_bug.cgi?id=4488 and will fix  
it soon.

	- Doug

More information about the cfe-dev mailing list