Don't finalize checking of base and member initializers for a
constructor template. Fixes PR10457. llvm-svn: 140350
This commit is contained in:
parent
e83e1b2d2c
commit
5223529b27
|
@ -2373,7 +2373,7 @@ bool Sema::SetCtorInitializers(CXXConstructorDecl *Constructor,
|
|||
CXXCtorInitializer **Initializers,
|
||||
unsigned NumInitializers,
|
||||
bool AnyErrors) {
|
||||
if (Constructor->getDeclContext()->isDependentContext()) {
|
||||
if (Constructor->isDependentContext()) {
|
||||
// Just store the initializers as written, they will be checked during
|
||||
// instantiation.
|
||||
if (NumInitializers > 0) {
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -std=c++0x %s -verify
|
||||
|
||||
namespace PR10457 {
|
||||
|
||||
class string
|
||||
{
|
||||
string(const char* str, unsigned);
|
||||
|
||||
public:
|
||||
template <unsigned N>
|
||||
string(const char (&str)[N])
|
||||
: string(str) {} // expected-error{{constructor for 'string<6>' creates a delegation cycle}}
|
||||
};
|
||||
|
||||
void f() {
|
||||
string s("hello");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue