This patch fixes PR16989.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196352
91177308-0d34-0410-b5e6-
96231b3b80d8
<< R.get()->getSourceRange();
} else
R = ParseExpression();
- if (R.isInvalid()) { // Skip to the semicolon, but don't consume it.
- SkipUntil(tok::semi, StopBeforeMatch);
+ if (R.isInvalid()) {
+ SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch);
return StmtError();
}
}
template class basic_stringbuf<char>;
}
+namespace pr16989 {
+ class C {
+ template <class T>
+ C tpl_mem(T *) { return } // expected-error{{expected expression}}
+ void mem(int *p) {
+ tpl_mem(p);
+ }
+ };
+ class C2 {
+ void f();
+ };
+ void C2::f() {}
+}