Bug 162556
Summary: | Compiler error when compiling call to templated function within a templated class | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Michael Doppler <m.doppler> |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED WONTFIX | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3.0 | CC: | aoliva, jason |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2005-09-27 09:17:36 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Michael Doppler
2005-07-06 10:14:38 UTC
This is one of those cases in which the C++ grammar is ambiguous, and the parser in GCC 3.2 wasn't smart enough to tell how to parse the statement because of limitations in the tools used to create it. The new parser, introduced in GCC 3.4, was able to overcome this limitation, but it's nearly impossible to backport the fix. A syntactic disambiguation, suggested by the standard for situations in which the postfix-expression before the `.' is template-dependent but accepted in other cases as well, is to add the `template' keyword before the template-id, like this: b.template getValue<int>(); This code is accepted by GCC 3.2, 3.4, 4.0 and should be accepted by any other C++ Standard-compliant compilers. Thank you for clarifying this issue. Because resolving the ambiguity works around the problem and a parser backport is not feasible I set this bug to resolved wontfix. |