From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Davis Herring Newsgroups: gmane.emacs.bugs Subject: bug#34789: Scan of regexp mistakes Date: Fri, 8 Mar 2019 13:46:38 -0700 Organization: XCP-1 Message-ID: <44d068d3-613c-be0c-b4c4-45fff79f53dc@lanl.gov> References: <3ef768c2-98d9-a42d-067a-4a5ffc945cf4@cs.ucla.edu> <1c44342f-01ab-1bc6-4b5c-3485a6f01fda@lanl.gov> <61035fed-564a-8766-8982-0d05acea341c@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="259900"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 To: 34789@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 08 22:19:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h2Mtb-0015Uz-JW for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Mar 2019 22:19:12 +0100 Original-Received: from localhost ([127.0.0.1]:50062 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Mta-0008La-Ak for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Mar 2019 16:19:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2MtT-0008LS-Ga for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 16:19:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2MtS-00085F-Ix for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 16:19:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51462) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2MtS-00084x-2g for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 16:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h2MtR-0004mT-TQ for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 16:19:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Davis Herring Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Mar 2019 21:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34789 X-GNU-PR-Package: emacs Original-Received: via spool by 34789-submit@debbugs.gnu.org id=B34789.155207991118332 (code B ref 34789); Fri, 08 Mar 2019 21:19:01 +0000 Original-Received: (at 34789) by debbugs.gnu.org; 8 Mar 2019 21:18:31 +0000 Original-Received: from localhost ([127.0.0.1]:36773 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2Msx-0004lc-3p for submit@debbugs.gnu.org; Fri, 08 Mar 2019 16:18:31 -0500 Original-Received: from proofpoint7.lanl.gov ([204.121.3.46]:48458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2MOF-0003xQ-HK for 34789@debbugs.gnu.org; Fri, 08 Mar 2019 15:46:49 -0500 Original-Received: from pps.filterd (proofpoint7.lanl.gov [127.0.0.1]) by proofpoint7.lanl.gov (8.16.0.22/8.16.0.22) with SMTP id x28KgFOL145865 for <34789@debbugs.gnu.org>; Fri, 8 Mar 2019 13:46:39 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lanl.gov; h=subject : to : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=lanl; bh=hVMM5KThaoVJ5GtA6eaxOzuCR3MkqMXRca8F+TJ9vQg=; b=M10WtnYsrprdhGk/PuGLF7QQvCw6ploq1KDpUQy2BJqB+0WERU92LAxqkfFFDhcJB+b5 L5w5ohQjDxKgRrKKJGp+g0jtELeN89+ADTP6EugILrCfjlfvvsPQRoVyNoYYAcOLafgz ez4F4+C7v75iaDMN9kYeEMpeDLg/wYmpIwV1eI896ASFHpaOZFZYLVFGS247WT6j5vaG JM3/O1TFDXNt/+1d2JKUfmmpRMSYXpGr6IUW5Sh5G/kpktM6v11tZr2OkiVXo+zq1DCv tYnNDR/Wa1pUPm38TzjPPSuUclpfq7/u0ciufLjsJPiZqrwkKtdhA91n3HAeN6Ou1vGL aw== Original-Received: from mailrelay2.lanl.gov (mailrelay2.lanl.gov [128.165.4.103]) by proofpoint7.lanl.gov with ESMTP id 2qys3gusbn-1 for <34789@debbugs.gnu.org>; Fri, 08 Mar 2019 13:46:38 -0700 Original-Received: from localhost (localhost [127.0.0.1]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 5E71F100199B for <34789@debbugs.gnu.org>; Fri, 8 Mar 2019 13:46:38 -0700 (MST) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay2.lanl.gov Original-Received: from bismuth.lanl.gov (bismuth.lanl.gov [128.165.246.103]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 4D7CB100AD2F for <34789@debbugs.gnu.org>; Fri, 8 Mar 2019 13:46:38 -0700 (MST) In-Reply-To: <61035fed-564a-8766-8982-0d05acea341c@cs.ucla.edu> Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-08_18:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903080144 X-Mailman-Approved-At: Fri, 08 Mar 2019 16:18:30 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156171 Archived-At: > But I'd like first to hear in more detail why "C++ compilers haven't > worked that way for any standard library type (and most user-defined > types) in a very long time." We should at least have this information > recorded here for posterity. The situation in question (based on the comments in mantemp.el) concerns code like #include int main() { std::vector v(1); return *v.begin(); // 0 } where, once upon a time, the compiler would emit undefined references to functions like "std::vector::begin()" that had to be explicitly instantiated (in a single translation unit chosen by the user). (The age of this era is indicated by the missing "std::" in the example error messages.) In all compilers newer than about 2003, such functions are automatically _generated_ when used, so that there are no undefined references (and no need to manually request instantiation). It is still _possible_ to instantiate things this way for performance reasons in certain complicated cases, but you have to ask for it: // foo.hxx #ifndef FOO_HXX #define FOO_HXX #include struct A {}; // a user-defined type must be involved extern template class std::vector; // block implicit instantiation #endif // templates.cxx #include"foo.hxx" // The one shared instantiation, as mantemp.el could generate: template class std::vector; // client.cxx #include"foo.hxx" vector gv; // relies on templates.cxx // possibly more clients... // main.cxx #include"foo.hxx" int main() { vector v; // relies on templates.cxx return v.size(); } (This is C++11 code; in C++03, only user-defined types can be made to behave this way, and it's harder.) This style of code is rare, and will if anything become rarer still in C++20, when code in a header file that uses a particular specialization (e.g., std::vector) can be put into a module that is compiled only once. Even if someone were doing this, mantemp.el could at most generate the one indicated line in templates.cxx _after_ the very similar line in foo.hxx was added in some other fashion. Hope this helps clarify, Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.