The following code failed with the message (no options are given to the compiler): instance.cc: In function 'int main()': instance.cc:30: error: no matching function for call to 'c_struct<a_tags, a_struct>::c_struct(a0_type&)' instance.cc:14: note: candidates are: c_struct<a_tags, a_struct>::c_struct(const c_struct<a_tags, a_struct>&) --------------------------------------- enum a_tags { A0, A1 }; enum b_tags { B0, B1 }; template < a_tags Tag > struct a_struct {}; template < b_tags Tag > struct b_struct {}; template < typename tags, template < tags > class Element > struct c_struct { template < tags Tag > c_struct(Element< Tag >) {} }; typedef c_struct< a_tags, a_struct > a_type; typedef c_struct< b_tags, b_struct > b_type; typedef a_struct< A0 > a0_type; typedef b_struct< B0 > b0_type; int main() { a0_type a0; b0_type b0; b_type b_instance(b0); a_type a_instance(a0); } ------------------------------ But if one of the line: b_type b_instance(b0); a_type a_instance(a0); is commented out, then the compilation succeeds. --------------------------- My g++ version, although I've been able to reproduce this bug with older versions of gcc: % /usr/local/env/gcc-4.4.0/bin/g++ -v Using built-in specs. Target: i386-apple-darwin9.6.0 Configured with: ../gcc-4.4.0/configure --prefix=/usr/local/env/gcc-4.4.0 --disable-nls --enable-languages=c,c++ Thread model: posix gcc version 4.4.0 (GCC)
Created attachment 17816 [details] Associated temporary file
Not target-specific, can reproduce on x86_64-linux (don't know what you expect, though).
Works in mainline, not a regression, thus closing as fixed.