aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2012-10-01 17:39:51 +0000
committerRichard Trieu <rtrieu@google.com>2012-10-01 17:39:51 +0000
commit568f785a76e0a21de20932abf09ce7653e651f92 (patch)
tree252635df0704589c838cbc38f1e155b8b7e995d8 /lib/Sema/SemaInit.cpp
parentca5d78d0bc3010164f2f9682967d64d7e305a167 (diff)
Cleaning up the self initialization checker.
-Allow Sema to do more processing on the initial Expr before checking it. -Remove the special conditions in HandleExpr() -Move the code so that only one call site is needed. -Removed the function from Sema and only call it locally. -Warn on potentially evaluated reference variables, not just casts to r-values. -Update tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164951 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r--lib/Sema/SemaInit.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 42fc84d432..f7a173fcc0 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -2819,14 +2819,6 @@ static void TryConstructorInitialization(Sema &S,
assert((!InitListSyntax || (NumArgs == 1 && isa<InitListExpr>(Args[0]))) &&
"InitListSyntax must come with a single initializer list argument.");
- // Check constructor arguments for self reference.
- if (DeclaratorDecl *DD = Entity.getDecl())
- // Parameters arguments are occassionially constructed with itself,
- // for instance, in recursive functions. Skip them.
- if (!isa<ParmVarDecl>(DD))
- for (unsigned i = 0; i < NumArgs; ++i)
- S.CheckSelfReference(DD, Args[i]);
-
// The type we're constructing needs to be complete.
if (S.RequireCompleteType(Kind.getLocation(), DestType, 0)) {
Sequence.setIncompleteTypeFailure(DestType);