From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- .../test/CXX/expr/expr.unary/expr.new/p2-cxx0x.cpp | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 clang/test/CXX/expr/expr.unary/expr.new/p2-cxx0x.cpp (limited to 'clang/test/CXX/expr/expr.unary/expr.new/p2-cxx0x.cpp') diff --git a/clang/test/CXX/expr/expr.unary/expr.new/p2-cxx0x.cpp b/clang/test/CXX/expr/expr.unary/expr.new/p2-cxx0x.cpp new file mode 100644 index 0000000..4ebbfce --- /dev/null +++ b/clang/test/CXX/expr/expr.unary/expr.new/p2-cxx0x.cpp @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 + +template +struct only { + only(T); + template only(U) = delete; +}; + +void f() { + only p = new const auto (0); + only q = new (auto) (0.0); + + new auto; // expected-error{{new expression for type 'auto' requires a constructor argument}} + new (const auto)(); // expected-error{{new expression for type 'auto const' requires a constructor argument}} + new (auto) (1,2,3); // expected-error{{new expression for type 'auto' contains multiple constructor arguments}} +} + +void p2example() { + only r = new auto(1); + auto x = new auto('a'); + + only testX = x; +} -- cgit v1.2.3