https://bugs.llvm.org/show_bug.cgi?id=49627

            Bug ID: 49627
           Summary: Static analyzer false positive UninitializedObject
                    with aggregate type as base
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: dcough...@apple.com
          Reporter: dm...@hotmail.com
                CC: dcough...@apple.com, llvm-bugs@lists.llvm.org

The following code falsely triggers warning for uninitialized object.

#include <cassert>

struct A {
    int x;

    // A(int a): x(a) {} // If I uncomment this, A is no longer aggregate,
                         // the warning is gone.
};

struct B:A {
    int y;
    B(int a, int b): A{a}, y(b) {} // fails to see the aggregate init A{a}
};

int main()
{
    B b(1, 3);
    assert(b.x == 1);
    assert(b.y == 3);
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to