Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367562 - Parser fails to disambiguate template specializations differing by a const
Summary: Parser fails to disambiguate template specializations differing by a const
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (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: 2011-12-26 20:28 EST by Nathan Ridge CLA
Modified: 2012-02-23 11:33 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 2011-12-26 20:28:24 EST
In the following code:


template <typename>
class A;

template <typename T>
class A<void (T::*)()>
{
};

template <typename T>
class A<void (T::*)() const>
{
};

struct S {};

int main()
{
    A<void (S::*)()> m;  // ERROR HERE: "'A<void (S::*)()>' is ambiguous"
}


GCC compiles the code fine and chooses the non-const specialization.
Comment 1 Markus Schorn CLA 2012-01-02 10:42:04 EST
Thanks, added testcase and fix.