aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Parse/Parser.cpp4
-rw-r--r--test/SemaCXX/decltype.cpp7
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index 7bf4220199..f4cdd619ce 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -1940,8 +1940,8 @@ bool BalancedDelimiterTracker::diagnoseMissingClose() {
}
P.Diag(P.Tok, DID);
P.Diag(LOpen, diag::note_matching) << LHSName;
- if (P.SkipUntil(Close))
- LClose = P.Tok.getLocation();
+ if (P.SkipUntil(Close, /*StopAtSemi*/ true, /*DontConsume*/ true))
+ LClose = P.ConsumeAnyToken();
return true;
}
diff --git a/test/SemaCXX/decltype.cpp b/test/SemaCXX/decltype.cpp
index f9bdececc4..ccde3dcfb3 100644
--- a/test/SemaCXX/decltype.cpp
+++ b/test/SemaCXX/decltype.cpp
@@ -36,3 +36,10 @@ struct C {
C(decltype(undeclared; // expected-error {{undeclared identifier}} \
// expected-error {{expected ')'}} expected-note {{to match this '('}}
};
+
+template<typename>
+class conditional {
+};
+
+void foo(conditional<decltype((1),int>) { // expected-note 2 {{to match this '('}} expected-error {{expected ')'}}
+} // expected-error {{expected function body after function declarator}} expected-error 2 {{expected '>'}} expected-error {{expected ')'}}