Summary: | [4.0 Regression] Parentheses elicit spurious error: "missing '>' to terminate the template argument list" | ||
---|---|---|---|
Product: | gcc | Reporter: | James Widman <widman> |
Component: | c++ | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | fang, gcc-bugs, pinskia |
Priority: | P2 | Keywords: | rejects-valid |
Version: | 4.0.0 | ||
Target Milestone: | 4.1.0 | ||
Host: | Target: | ||
Build: | Known to work: | 3.3.4 | |
Known to fail: | 3.4.2 4.0.2 | Last reconfirmed: | 2006-05-22 22:46:05 |
Description
James Widman
2006-05-22 20:08:16 UTC
Confirmed. I guess the workaround is to simply not use the parenthesis. Nevertheless, this is a regression introduced with the new parser in 3.4.0. W. By the way: whoever tackles this may also want to take a look at: template< int* p> struct A { }; template<> struct A<(int*)0>; ...which was made permissible by the recently-adopted wording that was proposed for Defect Report 354: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2006/n1998.html#354 James -- Case #1 in Comment #1 is accepted by current G++ 4.1 and mainline branches. I do not believe Case #2 is valid, as the standard says that a non-type template argument may be: the address of an object or function with external linkage, includ- ing function templates and function template-ids but excluding non- static class members, expressed as & id-expression Thus, the parentheses make this case invalid. Admittedly, that's pedantic, but I think that's what the standard says. Comment #3 is a separate enhancement request, and should be refiled separately. Thanks, -- Mark Fixed in GCC-4.1.0. Won't fix in GCC-4.0.x. |