Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c++ Subject: Re: newbie question: exceptions Date: Sun, 18 Aug 2019 05:18:34 -0700 Organization: A noiseless patient Spider Lines: 28 Message-ID: <86r25ibrad.fsf@mailhub.linuxsc.com> References: <8636hzcb91.fsf@mailhub.linuxsc.com> <06eeaff0-313d-4d9b-8f03-536185f59370@googlegroups.com> <45aa3238-fb53-42ef-99f9-ab2e71e5347d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="938936979bf6115e9d0086b39ae6a6d8"; logging-data="24331"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BSWH2G1sLnnJbJvFWgDxCKPl65x5utWM=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:hiiC3bZ0ySokq1ZqeTFkau2KeM0= sha1:5mqE4n7YOvj6pyFlFUAaEzrouHA= Xref: csiph.com comp.lang.c++:67749 Tiib writes: > On Sunday, 18 August 2019 09:18:33 UTC+3, Tiib wrote: > >> On Sunday, 18 August 2019 08:07:31 UTC+3, Tim Rentsch wrote: >> >>> Tiib writes: >>> >>>> On Tuesday, 13 August 2019 17:38:34 UTC+3, Jivanmukta wrote: >>>> [...] >>>> >>>>> Does it make sense to code: >>>>> >>>>> MyClass *myObj = MyClass(); >>>> >>>> No. It is usually syntax error, >>> >>> In most cases a diagnostic is required, but assuming MyClass >>> is a class (or struct), and there is no funny preprocessor >>> stuff going on, it is never a syntax error. >> >> I can demo that it is ill-formed on most trivial case: >> http://coliru.stacked-crooked.com/a/aa95b9b7035de3c3 > > Ok. I think I got it ... you meant it is not syntax error but > semantic error. Right.