mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Bug 460183 - Template resolution problem with trailing-return-type
function in index Change-Id: I87d1ef78b064d187b4dd204ce1e040b98418808b
This commit is contained in:
parent
43097ce04e
commit
b2f459e075
2 changed files with 37 additions and 1 deletions
|
@ -741,6 +741,40 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
|
|||
assertEquals(((ICPPBasicType)bar.getType().getReturnType()).getType(), IBasicType.t_void);
|
||||
}
|
||||
|
||||
// template<class T>
|
||||
// auto trailing_return_type(T& p) -> decltype(p.m());
|
||||
|
||||
// template<typename T>
|
||||
// struct A {
|
||||
// typedef T type;
|
||||
// };
|
||||
//
|
||||
// template<typename T>
|
||||
// typename A<T>::type declval();
|
||||
//
|
||||
// template<class T>
|
||||
// class B {};
|
||||
//
|
||||
// template <typename T>
|
||||
// using C = decltype(trailing_return_type(declval<T&>()));
|
||||
//
|
||||
// template <typename T>
|
||||
// B<C<T>> waldo(T& q);
|
||||
//
|
||||
// template<typename T>
|
||||
// struct D {
|
||||
// T* m();
|
||||
// };
|
||||
//
|
||||
// D<int> b;
|
||||
//
|
||||
// void test() {
|
||||
// waldo(b);
|
||||
// }
|
||||
public void testTrailingReturnType_460183() throws Exception {
|
||||
checkBindings();
|
||||
}
|
||||
|
||||
// template<typename T> class A {
|
||||
// public:
|
||||
// typedef T TD;
|
||||
|
|
|
@ -117,7 +117,9 @@ public final class TypeMarshalBuffer implements ITypeMarshalBuffer {
|
|||
fPos += 1;
|
||||
long rec= getRecordPointer();
|
||||
return (IBinding) PDOMNode.load(fLinkage.getPDOM(), rec);
|
||||
} else if (firstBytes == NULL_TYPE || firstBytes == UNSTORABLE_TYPE) {
|
||||
} else if (firstBytes == NULL_TYPE) {
|
||||
return null;
|
||||
} else if (firstBytes == UNSTORABLE_TYPE) {
|
||||
return new ProblemBinding(null, ISemanticProblem.TYPE_NOT_PERSISTED);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue