summaryrefslogtreecommitdiffstats
path: root/test/Parser/cxx-default-args.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-01-13 07:42:33 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-01-13 07:42:33 +0000
commit269798ba2cc9eda11d342d8ef68330cfd018e0db (patch)
tree4efc4c7d0f4544254bf94bcf5e3baa4e3e449376 /test/Parser/cxx-default-args.cpp
parent8f0f848a5e9da4fc3895bb8d24a35bc73539aef7 (diff)
Parse: Don't crash when default argument in typedef consists of sole '='
We'd crash trying to make the SourceRange for the tokens we'd like to highlight. Don't assume there is more than one token makes up the default argument. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225774 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx-default-args.cpp')
-rw-r--r--test/Parser/cxx-default-args.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/Parser/cxx-default-args.cpp b/test/Parser/cxx-default-args.cpp
index 0c028f7366..0095a2f04d 100644
--- a/test/Parser/cxx-default-args.cpp
+++ b/test/Parser/cxx-default-args.cpp
@@ -39,4 +39,5 @@ struct S {
struct U {
void i(int x = ) {} // expected-error{{expected expression}}
+ typedef int *fp(int x = ); // expected-error{{default arguments can only be specified for parameters in a function declaration}}
};