Tim Rentsch <tr.17687@z991.linuxsc.com>: Jul 26 02:31AM -0700 > compiled in more than one ways, there is an ambiguity; else, there is > no ambiguity and there is nothing to resolve. Long story short, I am > with gcc here. Humorous that the resolution of an ambiguity is written in such a way that the disambiguiting condition itself has an ambiguity. |
Renegat <renegat.nospam@gmail.com>: Jul 25 05:36PM -0700 Hello everybody, do you agree that the following template related problem is a bug in the g++ front-end of GCC? If someone with a GCC bugzilla account thinks so, maybe he can submit a bug report there (the automatic account creation has been restricted now). Thanks. /* Product: gcc Comp: c++ Versions: 11.4 / 12.3 / 13.1 (all currently supported) Summary: False access error for non-type template parameter of a nested class Keywords: rejects-valid, accepts-invalid */ // // The out-of-class definition of a nested class member template with a // private non-type template parameter triggers a false compilation error // class A { enum e{ E }; template <A::e T> struct class_template; }; // BUG #1: This definition outside the class body is valid, but g++ aborts // the compilation with an error: 'enum A::e' is private within this context' template <A::e T> struct A::class_template { }; // Maybe helpful for a bug fix: // The compilation error is not triggered for a similar class with a member // function template defined outside the class body class B { enum e{ E }; template <B::e T> void function_template(); }; // g++ compiles fine for a function template : template <B::e T> void B::function_template() { } // BUG #2: g++ compiles this without any error, but 'B::e' is private within // this context template <B::e T> void global_function_template() { } // No BUG here: For a similar class template the g++ compiler correctly reports // a compilation error ('enum B::e' is private within this context) template <B::e T> class global_class_template { }; |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment