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

Bug 361604

Summary: Template resolution problem with sizeof expression
Product: [Tools] CDT Reporter: Sergey Prigogin <eclipse.sprigogin>
Component: cdt-parserAssignee: Sergey Prigogin <eclipse.sprigogin>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: 8.0.2   
Hardware: All   
OS: All   
Whiteboard:

Description Sergey Prigogin CLA 2011-10-21 00:06:57 EDT
The following code example is derived from boost::ptr_vector:

template<bool V, typename T>
struct C {
  typedef int s;
};

template<typename T>
struct C<false, T> {
  typedef T s;
};

struct B {
  typedef B u;
};

typedef C<sizeof(char) == sizeof(int), B> r;
typedef r::s t;
t::u x;  // problem on t::u
Comment 1 Sergey Prigogin CLA 2011-10-21 00:34:23 EDT
A test case for this bug is in AST2TemplateTests._testBoolExpressionAsTemplateArgument_361604().
Comment 2 Sergey Prigogin CLA 2011-10-24 00:55:16 EDT
Fixed in cdt_8_0 and master.
Comment 3 CDT Genie CLA 2011-10-24 01:23:01 EDT
*** cdt git genie on behalf of Sergey Prigogin ***

    Bug 361604 - Template resolution problem with sizeof expression.

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=a83da09772f91b66f2616c52066ab18fc766e015
Comment 4 CDT Genie CLA 2011-10-24 01:23:03 EDT
*** cdt git genie on behalf of Sergey Prigogin ***

    Bug 361604 - Template resolution problem with sizeof expression.

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