This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33754] Default argument of type list < pair < A, B > > compiles only when typedef is used
- From: "photon at seznam dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Oct 2007 07:29:31 -0000
- Subject: [Bug c++/33754] Default argument of type list < pair < A, B > > compiles only when typedef is used
- References: <bug-33754-15110@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from photon at seznam dot cz 2007-10-15 07:29 -------
(In reply to comment #4)
> DR 325 describes the ambiguities in the standard. There are a number of
> possible solutions to accepting this syntax, with different implementation
> complexities, and it is not clear what the desired outcome is.
>
The desired outcome is clear in this case but the compiler does not recognize
the template arguments. Before encountering '=' the parser honors the template
argument separator with a higher priority than the function argument separator,
afterwards it does not. That does not make sense and certainly either the
standard or the compiler should be fixed.
> As there is a simple workaround -- adding parentheses -- which is unambiguously
> correct, I do not see a need to speculatively implement a language extension
> here.
>
Provided the standard is ambiguous, fixing this problem would not introduce a
language extension.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33754