https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58583
Mikhail Maltsev <miyuki at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED CC| |miyuki at gcc dot gnu.org Resolution|FIXED |--- --- Comment #7 from Mikhail Maltsev <miyuki at gcc dot gnu.org> --- The diagnostic differs between "--enable-checking=yes" and "--enable-checking=release" builds: Checking: miyuki@gcc-build1:~$ /opt/gcc-6-latest/bin/g++ -std=c++11 ./nsdmi-template14.C ./nsdmi-template14.C:6:20: error: constructor required before non-static data member for 'A<0>::i' has been parsed int i = (A<0>(), 0); // { dg-error "has been parsed" } ^ ./nsdmi-template14.C: In constructor 'constexpr A<0>::A()': ./nsdmi-template14.C:4:22: error: constructor required before non-static data member for 'A<0>::i' has been parsed template<int> struct A // { dg-error "has been parsed" } ^ ./nsdmi-template14.C: At global scope: ./nsdmi-template14.C:6:20: note: synthesized method 'constexpr A<0>::A()' first required here int i = (A<0>(), 0); // { dg-error "has been parsed" } ^ ./nsdmi-template14.C:14:6: error: recursive instantiation of non-static data member initializer for 'B<1>::p' B<1> x; // { dg-error "recursive instantiation of non-static data" } ^ Release: miyuki@gcc-build1:~$ /opt/gcc-6-latest-rel/bin/g++ -std=c++11 ./nsdmi-template14.C ./nsdmi-template14.C:14:6: error: recursive instantiation of non-static data member initializer for 'B<1>::p' B<1> x; // { dg-error "recursive instantiation of non-static data" } ^ The latter obviously does not pass the test.