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

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)
    int bar = 101;
    int bar2;

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

Best regards

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to