llvm-project/clang/test/SemaCXX/uninitialized-no-ctor.cpp
Aaron Ballman c609cd2df9
Give this diagnostic a diagnostic group (#136182)
I put this under -Wunitialized because that's the same group it's under
in GCC.

Fixes #41104
2025-04-18 07:09:27 -04:00

14 lines
512 B
C++

// RUN: %clang_cc1 -fsyntax-only -Wuninitialized -verify %s
// RUN: %clang_cc1 -fsyntax-only -Wno-uninitialized -verify=good %s
//good-no-diagnostics
template <class T>
class RefMem { // expected-warning {{class 'RefMem<int &>' does not declare any constructor to initialize its non-modifiable members}}
T &M; // expected-note {{reference member 'M' will never be initialized}}
};
struct RefRef {
RefMem<int &> R; // expected-note {{in instantiation of template class 'RefMem<int &>' requested here}}
};