1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 497931 - Added a failing test and a TODO in the problematic code

Change-Id: I9562d0452a3ba08b940d948e040580e858abaa39
This commit is contained in:
Sergey Prigogin 2016-07-15 11:17:07 -07:00 committed by Gerrit Code Review @ Eclipse.org
parent 19d7a44ada
commit 2d4d6b3e1c
2 changed files with 10 additions and 1 deletions

View file

@ -9463,6 +9463,14 @@ public class AST2TemplateTests extends AST2TestBase {
parseAndCheckBindings();
}
// template <int I, typename T>
// constexpr int waldo(T v) {
// return v < I ? 1 : 1 + waldo<I, T>(v / I);
// }
public void _testAmbiguityResolution_497931() throws Exception {
parseAndCheckBindings();
}
// template <typename> struct S {};
// struct U {};
//

View file

@ -118,8 +118,9 @@ final class TemplateIdStrategy implements ITemplateIdStrategy {
// Optimization (bug 363609): if during the previous alternative, a name was parsed as a
// template-id with multiple template arguments, it's not going to be parsed differently in
// a subsequent alternative, so keep it as a template-id.
// Of course, this optimization is only sound if the previous alternative was parsed
// Of course, this optimization is only possible if the previous alternative was parsed
// successfully (bug 445177).
// TODO: This optimization is invalid since it triggers bug 497931.
if (previousAlternativeFailedToParse || nameLen == 0 || !hasMultipleArgs(names[--nameLen])) {
fSimpleIDs.clear(bp+1, Integer.MAX_VALUE);
fSimpleIDs.set(bp);