https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65110

            Bug ID: 65110
           Summary: Does not accept multi-argument template in member
                    initialization
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stanshebs at earthlink dot net

The following snippet generates a host of complaints, presumably connected to
ambiguity of template argument list vs initializer list:

template<typename, typename> struct C { int n; };
struct D { int k = C<D, D>().n; };

$ cc -Wall -std=c++11 demo.cc
demo.cc:2:25: error: expected ‘;’ at end of member declaration
 struct D { int k = C<D, D>().n; };
                         ^
demo.cc:2:26: error: expected unqualified-id before ‘>’ token
 struct D { int k = C<D, D>().n; };
                          ^
demo.cc:2:22: error: wrong number of template arguments (1, should be 2)
 struct D { int k = C<D, D>().n; };
                      ^
demo.cc:1:37: error: provided for ‘template<class, class> struct C’
 template<typename, typename> struct C { int n; };
                                     ^

This occurs for both 4.8 and current trunk; current Clang accepts without any
complaints.

(Google ref: b/19213572)

Reply via email to