[PATCH] composite_type and TYPE_QUALS

Andrew Pinski apinski@apple.com
Wed Jun 23 10:38:00 GMT 2004


While trying to fix IMA, I came across the problem where composite_type
does not return a type which has the TYPE_QUALS of the other type given
to the function,  this patch fixes this problem, I could not find a non
IMA testcase for reproducing this failure.

OK? Bootstrapped on powerpc-apple-darwin with no regressions.

Testcase (which only happens you fix IMA):
file1.c:
typedef int *g;
void f(const g*);
void f(const g*a)  {}
file2.c:
typedef int *g;
void f(const g*);

I cannot remember which order you should list the files to get the 
failure
but after duplicate_decls is called the olddecl was changed so the 
pointer
to int was no longer a constant.


ChangeLog:

	* c-typeck.c (composite_type):
	<case POINTER_TYPE>: Build a qualified type of
	the new type.
	<case ARRAY_TYPE>: Likewise.
	<case FUNCTION_TYPE>: Likewise.

Patch:
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: temp.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040623/de3fb3dd/attachment.txt>


More information about the Gcc-patches mailing list