зеркало из https://github.com/microsoft/clang-1.git
Don't check member and base initializers if the constructor is dependent.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80211 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
5c36fb22d9
Коммит
8d4c5ea0ee
|
@ -947,6 +947,8 @@ void Sema::ActOnMemInitializers(DeclPtrTy ConstructorDecl,
|
|||
Diag(ColonLoc, diag::err_only_constructors_take_base_inits);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Constructor->isDependentContext()) {
|
||||
llvm::DenseMap<void*, CXXBaseOrMemberInitializer *>Members;
|
||||
bool err = false;
|
||||
for (unsigned i = 0; i < NumMemInits; i++) {
|
||||
|
@ -976,11 +978,15 @@ void Sema::ActOnMemInitializers(DeclPtrTy ConstructorDecl,
|
|||
|
||||
if (err)
|
||||
return;
|
||||
}
|
||||
|
||||
BuildBaseOrMemberInitializers(Context, Constructor,
|
||||
reinterpret_cast<CXXBaseOrMemberInitializer **>(MemInits),
|
||||
NumMemInits);
|
||||
|
||||
if (Constructor->isDependentContext())
|
||||
return;
|
||||
|
||||
if (Diags.getDiagnosticLevel(diag::warn_base_initialized) ==
|
||||
Diagnostic::Ignored &&
|
||||
Diags.getDiagnosticLevel(diag::warn_field_initialized) ==
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
// RUN: clang-cc -fsyntax-only -verify %s
|
||||
|
||||
template<typename T> struct A {
|
||||
A() : j(10), i(10) { }
|
||||
|
||||
int i;
|
||||
int j;
|
||||
};
|
||||
|
||||
template<typename T> struct B : A<T> {
|
||||
B() : A<T>() { }
|
||||
};
|
||||
|
Загрузка…
Ссылка в новой задаче