Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337686 - Error when using decltype in template parameter
Summary: Error when using decltype in template parameter
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
: 337688 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-21 02:57 EST by Nathan Ridge CLA
Modified: 2011-03-02 10:22 EST (History)
1 user (show)

See Also:


Attachments
testcase + fix (2.31 KB, patch)
2011-03-02 05:29 EST, Markus Schorn CLA
mschorn.eclipse: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***