[PATCH] Unnecessary reference type in SemaExpr.cpp

Christian Wailes chriswailes at google.com
Tue Sep 3 14:30:58 PDT 2013


Hi delesley, aaron.ballman, dblaikie,

The getDefaultPolicy() function returns a value and not a reference.

http://llvm-reviews.chandlerc.com/D1589

Files:
  lib/Sema/SemaExpr.cpp

Index: lib/Sema/SemaExpr.cpp
===================================================================
--- lib/Sema/SemaExpr.cpp
+++ lib/Sema/SemaExpr.cpp
@@ -10236,7 +10236,7 @@
     computeNRVO(Body, getCurBlock());
   
   BlockExpr *Result = new (Context) BlockExpr(BSI->TheDecl, BlockTy);
-  const AnalysisBasedWarnings::Policy &WP = AnalysisWarnings.getDefaultPolicy();
+  const AnalysisBasedWarnings::Policy WP = AnalysisWarnings.getDefaultPolicy();
   PopFunctionScopeInfo(&WP, Result->getBlockDecl(), Result);
 
   // If the block isn't obviously global, i.e. it captures anything at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1589.1.patch
Type: text/x-patch
Size: 586 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130903/72149b3a/attachment.bin>


More information about the cfe-commits mailing list