================
Comment at: lib/Parse/ParseCXXInlineMethods.cpp:73
@@ -72,3 +72,3 @@
     bool Delete = false;
     SourceLocation KWLoc;
     if (TryConsumeToken(tok::kw_delete, KWLoc)) {
----------------
Any reason we can't save Tok.getEndLoc() here? Then we don't have to hardcode 
the lengths of delete and default.

================
Comment at: lib/Parse/ParseCXXInlineMethods.cpp:80
@@ -79,1 +79,3 @@
       Delete = true;
+      if (auto *DeclAsFunction = dyn_cast<FunctionDecl>(FnD)) {
+        // The end of this decl has to point to the end of the 'delete' keyword
----------------
This doesn't do the right thing for function templates, which the only case 
where this dyn_cast can fail. I think you can write a templated constructor and 
default it. =P A robust way to do this might be:
  auto *FD = dyn_cast<FunctionDecl>(FnD);
  FD = FD ? FD : cast<FunctionTemplateDecl>(FnD)->getTemplatedDecl();
  FD->setRangeEnd(KWEndLoc);

http://reviews.llvm.org/D8465

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to