Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368610 - [regression] 'auto' type deduction failure involving templates
Summary: [regression] 'auto' type deduction failure involving templates
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 8.1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 8.1.0   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-14 19:51 EST by Nathan Ridge CLA
Modified: 2012-02-29 13:21 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Ridge CLA 2012-01-14 19:51:12 EST
struct S
{
    int x;
};

template <typename>
struct iterator_base
{
    S operator*();
};

template <typename>
struct A
{
    struct iterator : public iterator_base<iterator>
    {
    };
};

int main()
{
    A<int>::iterator it;
    auto s = *it;
    s.x;  // ERROR HERE: "Field 'x' could not be resolved"
}


The error goes away if either class is made a nontemplate.

This worked fine in previous Juno builds.
Comment 1 Markus Schorn CLA 2012-01-16 09:33:42 EST
Added testcases and fix.
Comment 2 Nathan Ridge CLA 2012-01-18 10:46:54 EST
Thanks Markus for your prompt bug fixes!

I'm done with reporting bugs for a while, as the vast majority of the remaining false positive errors in our codebase reduce to uses of dependent expressions :)
Comment 3 CDT Genie CLA 2012-02-29 13:21:42 EST
*** cdt git genie on behalf of Markus Schorn ***

    Bug 368610: Specialization of classes used as template args

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=66f92bb58277c3cc845249c089b0bf28b9e0312e