Author: dgregor Date: Wed Jun 16 18:45:56 2010 New Revision: 106175 URL: http://llvm.org/viewvc/llvm-project?rev=106175&view=rev Log: When parsing cached C++ method declarations/definitions, save the "previous token" location at the end of the class definition. This eliminates a badly-placed error + Fix-It when the ';' following a class definition is missing. Fixes <rdar://problem/8066414>.
Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp cfe/trunk/test/SemaCXX/class.cpp Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=106175&r1=106174&r2=106175&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original) +++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Wed Jun 16 18:45:56 2010 @@ -1619,8 +1619,10 @@ // We are not inside a nested class. This class and its nested classes // are complete and we can parse the delayed portions of method // declarations and the lexed inline method definitions. + SourceLocation SavedPrevTokLocation = PrevTokLocation; ParseLexedMethodDeclarations(getCurrentClass()); ParseLexedMethodDefs(getCurrentClass()); + PrevTokLocation = SavedPrevTokLocation; } if (TagDecl) Modified: cfe/trunk/test/SemaCXX/class.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/class.cpp?rev=106175&r1=106174&r2=106175&view=diff ============================================================================== --- cfe/trunk/test/SemaCXX/class.cpp (original) +++ cfe/trunk/test/SemaCXX/class.cpp Wed Jun 16 18:45:56 2010 @@ -159,3 +159,9 @@ } }; } + +namespace rdar8066414 { + class C { + C() {} + } // expected-error{{expected ';' after class}} +} _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits