================
@@ -1132,6 +1132,12 @@ void Parser::AnnotateExistingDecltypeSpecifier(const 
DeclSpec &DS,
   // make sure we have a token we can turn into an annotation token
   if (PP.isBacktrackEnabled()) {
     PP.RevertCachedTokens(1);
+    if (DS.getTypeSpecType() == TST_error) {
+      // make sure we have meaningful cached tokens
+      if (EndLoc.isValid() && StartLoc.isValid() && EndLoc != StartLoc) {
----------------
erichkeane wrote:

Not really a bit of code I play with, the != and `EndLoc` conditions here seem 
odd to me.  Why do we care that the `EndLoc`, which we are going to assign, is 
valid?  And why would them being different matter for the caching? 

https://github.com/llvm/llvm-project/pull/167114
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to