Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.law/ctors17.C

raw
1 // { dg-do assemble }
2 // { dg-skip-if "requires hosted libstdc++ for fstream" { ! hostedlib } }
3 // GROUPS passed constructors
4 // ctor file
5 // Message-Id: <[email protected]>
6 // From: [email protected] (Stephan Muehlstrasser)
7 // Subject: gcc 2.4.3.1: illegal constructor call not rejected
8 // Date: Tue, 15 Jun 1993 18:34:14 +0200 (MET DST)
9
10 // C++0x mode doesn't print the deleted copy constructor as a candidate.
11 // { dg-prune-output ":14:" }
12
13 #include <fstream>
14
15 class X : public std::ifstream {
16 public:
17 X(int a, const char *b) {} // { dg-message "note" } candidate
18 };
19 int main()
20 {
21 X *y = new X(10, "123");
22 // the compiler must reject this constructor call:
23 X *x = new X("abc");// { dg-error "match" }
24 }