Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 337686

Summary: Error when using decltype in template parameter
Product: [Tools] CDT Reporter: Nathan Ridge <zeratul976>
Component: cdt-indexerAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: 8.0   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
testcase + fix mschorn.eclipse: iplog-

Description Nathan Ridge CLA 2011-02-21 02:57:54 EST
For the following code:

template <typename T>
class A {};

template <typename Functor>
void f(Functor functor)
{
    A<decltype(functor())> a;  // ERROR HERE
}

The parser gives the error: Invalid template arguments

The code compiles fine with gcc >= 4.3
Comment 1 Markus Schorn CLA 2011-03-02 05:29:42 EST
Created attachment 190122 [details]
testcase + fix
Comment 2 Markus Schorn CLA 2011-03-02 05:30:46 EST
Fixed in 8.0 > 20110302.
Comment 4 Markus Schorn CLA 2011-03-02 10:22:45 EST
*** Bug 337688 has been marked as a duplicate of this bug. ***