diff options
Diffstat (limited to 'test/SemaCXX/member-expr.cpp')
-rw-r--r-- | test/SemaCXX/member-expr.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaCXX/member-expr.cpp b/test/SemaCXX/member-expr.cpp index dbddd1c..763f9c7 100644 --- a/test/SemaCXX/member-expr.cpp +++ b/test/SemaCXX/member-expr.cpp @@ -157,3 +157,13 @@ namespace FuncInMemberExpr { Vec fun3(int x = 0); int test3() { return fun3.size(); } // expected-error {{base of member reference is a function; perhaps you meant to call it with no arguments}} } + +namespace DotForSemiTypo { +void f(int i) { + // If the programmer typo'd '.' for ';', make sure we point at the '.' rather + // than the "field name" (whatever the first token on the next line happens to + // be). + int j = i. // expected-error {{member reference base type 'int' is not a structure or union}} + j = 0; +} +} |