diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-02-16 09:31:36 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-02-16 09:31:36 +0000 |
| commit | ecb7e5c8afe929ee38155db94de6b084ec32a645 (patch) | |
| tree | 53010172e19c77ea447bcd89e117cda052ab52e0 /test/CXX/dcl.decl/dcl.init/p6.cpp | |
| parent | 5044f5c816adfd5cba17f1adee1a10127296d0bf (diff) | |
Notes
Diffstat (limited to 'test/CXX/dcl.decl/dcl.init/p6.cpp')
| -rw-r--r-- | test/CXX/dcl.decl/dcl.init/p6.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CXX/dcl.decl/dcl.init/p6.cpp b/test/CXX/dcl.decl/dcl.init/p6.cpp new file mode 100644 index 000000000000..f627a199eca6 --- /dev/null +++ b/test/CXX/dcl.decl/dcl.init/p6.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +// FIXME: Very incomplete! + +// If a program calls for the default initialization of an object of a +// const-qualified type T, T shall be a class type with a +// user-provided default constructor. +struct NoUserDefault { }; +struct HasUserDefault { HasUserDefault(); }; + +void test_const_default_init() { + const NoUserDefault x1; // expected-error{{default initialization of an object of const type 'struct NoUserDefault const' requires a user-provided default constructor}} + const HasUserDefault x2; + const int x3; // expected-error{{default initialization of an object of const type 'int const'}} +} |
