From ecb7e5c8afe929ee38155db94de6b084ec32a645 Mon Sep 17 00:00:00 2001 From: Roman Divacky Date: Tue, 16 Feb 2010 09:31:36 +0000 Subject: Update clang to r96341. --- test/CXX/dcl.decl/dcl.init/p6.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/CXX/dcl.decl/dcl.init/p6.cpp (limited to 'test/CXX/dcl.decl/dcl.init/p6.cpp') 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'}} +} -- cgit v1.3