summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Parse/ParseDecl.cpp9
-rw-r--r--clang/test/Parser/cxx-decl.cpp3
-rw-r--r--clang/test/SemaCXX/nested-name-spec.cpp3
3 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 5b8963f892c..da3ee1df7c5 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -380,15 +380,12 @@ ParseInitDeclaratorListAfterFirstDeclarator(Declarator &D) {
ExprVector Exprs(Actions);
CommaLocsTy CommaLocs;
- bool InvalidExpr = false;
if (ParseExpressionList(Exprs, CommaLocs)) {
SkipUntil(tok::r_paren);
- InvalidExpr = true;
- }
- // Match the ')'.
- SourceLocation RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
+ } else {
+ // Match the ')'.
+ SourceLocation RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
- if (!InvalidExpr) {
assert(!Exprs.empty() && Exprs.size()-1 == CommaLocs.size() &&
"Unexpected number of commas!");
Actions.AddCXXDirectInitializerToDecl(ThisDecl, LParenLoc,
diff --git a/clang/test/Parser/cxx-decl.cpp b/clang/test/Parser/cxx-decl.cpp
new file mode 100644
index 00000000000..3fa284282ad
--- /dev/null
+++ b/clang/test/Parser/cxx-decl.cpp
@@ -0,0 +1,3 @@
+// RUN: clang-cc -verify -fsyntax-only %s
+
+int x(*g); // expected-error {{use of undeclared identifier 'g'}}
diff --git a/clang/test/SemaCXX/nested-name-spec.cpp b/clang/test/SemaCXX/nested-name-spec.cpp
index fe92aab9a26..29fa001e0ff 100644
--- a/clang/test/SemaCXX/nested-name-spec.cpp
+++ b/clang/test/SemaCXX/nested-name-spec.cpp
@@ -93,7 +93,8 @@ void f3() {
}
// make sure the following doesn't hit any asserts
-void f4(undef::C); // expected-error {{use of undeclared identifier 'undef'}} // expected-error {{expected ')'}} expected-note {{to match this '('}} // expected-error {{variable has incomplete type 'void'}}
+void f4(undef::C); // expected-error {{use of undeclared identifier 'undef'}} \
+ expected-error {{variable has incomplete type 'void'}}
typedef void C2::f5(int); // expected-error{{typedef declarator cannot be qualified}}
OpenPOWER on IntegriCloud