]> granicus.if.org Git - clang/commit
Revert "Fold dangling-field warning into general initialization lifetime checks."
authorIlya Biryukov <ibiryukov@google.com>
Mon, 23 Jul 2018 06:32:36 +0000 (06:32 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Mon, 23 Jul 2018 06:32:36 +0000 (06:32 +0000)
commit547ca57a7d60b97bcd9c9f0c9f072a6e7b2f5f5d
tree4b8d66bd41c2a0d1cc1bd038e96bf91361abf3a6
parent85eda8e66a1ec5948d5f10c7091f339c6fd1a2a6
Revert "Fold dangling-field warning into general initialization lifetime checks."

This reverts commit r337627.
After the change, clang started producing invalid warning on the following code:
    struct foo {
      foo(char *x) : x_(&x[10]) {}
    private:
      char *x_;
    };

1.cpp:2:21: warning: initializing pointer member 'x_' with the stack address of parameter 'x' [-Wdangling-field]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337671 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaInit.cpp
test/Analysis/cxx-uninitialized-object-ptr-ref.cpp
test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp