summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/delegating-constructors.cpp
blob: 5c7d85f6ed5ae669c0a6908ab2b237d18ee6049c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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");
  }
}
OpenPOWER on IntegriCloud