summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/uninitialized.cpp
blob: 26202fbccc8176a423a1d5670c1c6bf3c9a039bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// RUN: %clang_cc1 -fsyntax-only -Wall -Wuninitialized -verify %s

// Previously this triggered a warning on the sizeof(fieldB), indicating
// a use of an uninitialized value.
class Rdar8610363_A {
  int fieldA;
public:
  Rdar8610363_A(int a); 
};
class Rdar8610363_B {
  Rdar8610363_A fieldB;
public:
  Rdar8610363_B(int b) : fieldB(sizeof(fieldB)) {} // no-warning
};
OpenPOWER on IntegriCloud