]> granicus.if.org Git - clang/commit
Rework our handling of temporary objects within the conditions of
authorDouglas Gregor <dgregor@apple.com>
Thu, 6 May 2010 17:25:47 +0000 (17:25 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 6 May 2010 17:25:47 +0000 (17:25 +0000)
commit586596fd7f7a336a2847b300c80614dcf39ab6d5
tree2921da607a64f6a81e89d4f8978990586e44c006
parent97a73cd8e2b81f5aed9f59e07e7787e3fd3b8d00
Rework our handling of temporary objects within the conditions of
if/switch/while/do/for statements. Previously, we would end up either:

  (1) Forgetting to destroy temporaries created in the condition (!),
  (2) Destroying the temporaries created in the condition *before*
  converting the condition to a boolean value (or, in the case of a
  switch statement, to an integral or enumeral value), or
  (3) In a for statement, destroying the condition's temporaries at
  the end of the increment expression (!).

We now destroy temporaries in conditions at the right times. This
required some tweaking of the Parse/Sema interaction, since the parser
was building full expressions too early in many places.

Fixes PR7067.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103187 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Parse/Action.h
include/clang/Parse/Parser.h
lib/Frontend/PrintParserCallbacks.cpp
lib/Parse/ParseExprCXX.cpp
lib/Parse/ParseStmt.cpp
lib/Sema/Sema.h
lib/Sema/SemaExpr.cpp
lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaStmt.cpp
lib/Sema/TreeTransform.h
test/CodeGenCXX/condition.cpp