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

            Bug ID: 36568
           Summary: Incorrect "uninitialized field" warning when using
                    default initialized member in template constructor
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: unassignedclangb...@nondot.org
          Reporter: l...@napatech.com
                CC: llvm-bugs@lists.llvm.org

Compiling the program below gives, to my belief, an incorrect warning.
Clang 5.0.0, compile options: -Wall --std=c++14
Note: GCC doesn't give any warning.

---------------------------------------------------------------
struct Foo
{
    template <typename TFoo>
    Foo() : bar2(bar)
    {
    }
private:
    int bar = 101;
    int bar2;
};

---------------------------------------------------------------
<source>:4:18: warning: field 'bar' is uninitialized when used here
[-Wuninitialized]
    Foo() : bar2(bar)



Best regards
  Lars

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

Reply via email to