From stdcxx-commits-return-1908-apmail-incubator-stdcxx-commits-archive=incubator.apache.org@incubator.apache.org Thu Oct 11 00:17:15 2007 Return-Path: Delivered-To: apmail-incubator-stdcxx-commits-archive@www.apache.org Received: (qmail 80256 invoked from network); 11 Oct 2007 00:17:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Oct 2007 00:17:15 -0000 Received: (qmail 79123 invoked by uid 500); 11 Oct 2007 00:17:03 -0000 Delivered-To: apmail-incubator-stdcxx-commits-archive@incubator.apache.org Received: (qmail 79111 invoked by uid 500); 11 Oct 2007 00:17:03 -0000 Mailing-List: contact stdcxx-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-commits@incubator.apache.org Received: (qmail 79100 invoked by uid 99); 11 Oct 2007 00:17:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Oct 2007 17:17:02 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2007 00:17:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7913A1A9832; Wed, 10 Oct 2007 17:16:24 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r583647 - /incubator/stdcxx/trunk/tests/regress/26.valarray.unary.stdcxx-314.cpp Date: Thu, 11 Oct 2007 00:16:24 -0000 To: stdcxx-commits@incubator.apache.org From: sebor@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071011001624.7913A1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebor Date: Wed Oct 10 17:16:23 2007 New Revision: 583647 URL: http://svn.apache.org/viewvc?rev=583647&view=rev Log: 2007-10-10 Martin Sebor * 26.valarray.unary.stdcxx-314.cpp: Regression test for STDCXX-314. Added: incubator/stdcxx/trunk/tests/regress/26.valarray.unary.stdcxx-314.cpp (with props) Added: incubator/stdcxx/trunk/tests/regress/26.valarray.unary.stdcxx-314.cpp URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/regress/26.valarray.unary.stdcxx-314.cpp?rev=583647&view=auto ============================================================================== --- incubator/stdcxx/trunk/tests/regress/26.valarray.unary.stdcxx-314.cpp (added) +++ incubator/stdcxx/trunk/tests/regress/26.valarray.unary.stdcxx-314.cpp Wed Oct 10 17:16:23 2007 @@ -0,0 +1,69 @@ +/************************************************************************ + * + * 26.valarray.unary.stdcxx-314.cpp - regression test for STDCXX-314 + * + * http://issues.apache.org/jira/browse/STDCXX-314 + * + * $Id:$ + * + *************************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. See the License for the specific language governing + * permissions and limitations under the License. + * + **************************************************************************/ + +#include +#include +#include +#include +#include + + +void* operator new (std::size_t s) throw (std::bad_alloc) +{ + return std::memset (std::malloc (s), 0x55, s); +} + +void operator delete (void *ptr) throw () +{ + std::free (ptr); +} + + +struct S { + const S* const self; + S (): self (this) { } + S (const S &s): self (this) { assert (&s == s.self); } + ~S () { assert (this == self); } + + S operator+ () const { assert (this == self); return *this; } + S operator- () const { assert (this == self); return *this; } + S operator~ () const { assert (this == self); return *this; } + bool operator! () const { assert (this == self); return false; } + +void operator= (const S &s) { assert (this == self && &s == s.self); } +}; + +int main () +{ + const std::valarray a (2); + + +a; + -a; + ~a; + !a; +} Propchange: incubator/stdcxx/trunk/tests/regress/26.valarray.unary.stdcxx-314.cpp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/stdcxx/trunk/tests/regress/26.valarray.unary.stdcxx-314.cpp ------------------------------------------------------------------------------ svn:keywords = Id