PR c++/18672 concerns some templatized c++ code. However the fault
is not template based, and as you'll see I have a non-template test
case.
The bug is in canonicalize_addr_expr, which presumes an array's
elements cannot have incomplete type. That is incorrect as
struct X;
extern struct X ary[];
is perfectly legal C and C++. when the address of ARY is taken,
C produces an expression of type 'struct X *', whereas C++ produces
one of type 'struct X (*)[]', and that confuses the canonicalizer.
Whilst there I noticed some redundant checks in gimplify_conversion.
That function's comment says the EXPR is already a NOP_EXPR or
CONVERT_EXPR, and indeed its only caller enforces that.
booted & tested on i686-pc-linux-gnu, ok?