diff options
-rw-r--r-- | include/clang/Sema/Initialization.h | 3 | ||||
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/include/clang/Sema/Initialization.h b/include/clang/Sema/Initialization.h index e83e5c0ccf..b64a63fb69 100644 --- a/include/clang/Sema/Initialization.h +++ b/include/clang/Sema/Initialization.h @@ -101,7 +101,8 @@ private: /// the temporary is being created. unsigned Location; - /// \brief Whether the + /// \brief Whether the entity being initialized may end up using the + /// named return value optimization (NRVO). bool NRVO; } LocAndNRVO; diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 60fcb10d53..536e86573b 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -1456,7 +1456,10 @@ Sema::ActOnBreakStmt(SourceLocation BreakLoc, Scope *CurScope) { /// \param E The expression being returned from the function or block, or /// being thrown. /// -/// \param AllowFunctionParameter +/// \param AllowFunctionParameter Whether we allow function parameters to +/// be considered NRVO candidates. C++ prohibits this for NRVO itself, but +/// we re-use this logic to determine whether we should try to move as part of +/// a return or throw (which does allow function parameters). /// /// \returns The NRVO candidate variable, if the return statement may use the /// NRVO, or NULL if there is no such candidate. |