From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by sourceware.org (Postfix) with ESMTPS id E7A813892005; Wed, 12 May 2021 09:58:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E7A813892005 Received: by mail-qt1-x833.google.com with SMTP id j19so16754747qtp.7; Wed, 12 May 2021 02:58:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ccmPOvyT3XCTldl73RhWsEIrDa7MBIFNPldVFLSPBfQ=; b=mMxY4gHC1J9R7KMC7C2KuLxqyLmM2c24t631QrXS3Zwg5dmjGIP3J1XcyMis7QzLTb S+iRJNVW3JnRnaXeKatNKM0GRxwDLILvLjswwTvDmMWVJpBH/A+uNcu66umzyckA+7oX 1MCH9q+GXZjPLq2WIVMMdpw2Lpkt6KlT0mub0uBdCk659DzG6sK3rkdHMTGkJ+82hDxn jEHtuQs4Xh3OAW6l6RSLcrTnoVl9zm+BzBAJ1RND39tfptzU4fjRvFiYshcjoMYMPtmp pQPIvZ4QONStHNRursDas51Ox3q6S5I0pd0J6I9fatR0uPwtITJeS5DqHe4Isu4tUeXt 43TA== X-Gm-Message-State: AOAM532atN0EGrj6MZU3uWt4g2z83Jso/Ii2Z3oeT8CuVOB718cu/VFR KBMyhQKowZRWijTWDYKFcw/ftGPcWqwnsi4q3J+U38/qUEQJ6g== X-Google-Smtp-Source: ABdhPJwe8nuzHy1t7bMCHnnmrC2dm6RiNN6bCp75gV+sdqkM5SGIfmYwy1DtJzRS0qkA+erU96Eht4XQjZ818iImgd8= X-Received: by 2002:ac8:505a:: with SMTP id h26mr22901233qtm.252.1620813508556; Wed, 12 May 2021 02:58:28 -0700 (PDT) MIME-Version: 1.0 References: <20210511200031.GZ3008@redhat.com> <20210512091833.GA3008@redhat.com> In-Reply-To: <20210512091833.GA3008@redhat.com> From: Antony Polukhin Date: Wed, 12 May 2021 12:58:16 +0300 Message-ID: Subject: Re: [PATCH] PR libstdc++/89728 diagnose some missuses of [locale.convenience] functions To: Jonathan Wakely Cc: "libstdc++" , gcc-patches List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 May 2021 09:58:30 -0000 =D1=81=D1=80, 12 =D0=BC=D0=B0=D1=8F 2021 =D0=B3. =D0=B2 12:18, Jonathan Wak= ely : <...> > Or just leave it undefined, as libc++ seems to do according to your > comment in PR 89728: > > error: implicit instantiation of undefined template 'std::__1::ctype >' > > Was your aim to have a static_assert that gives a more descriptive > error? We could leave it undefined in C++98 and have the static assert > for C++11 and up. Leaving it undefined would be the best. It would allow SFINAE on ctype and a compile time error is informative enough. However, there may be users who instantiate ctype in a shared library without ctype template specializations in the main executable. Making the default ctype undefined would break their compilation: #include // no ctype specialization c =3D std::tolower(ThierChar{42}, locale_from_shared_library()); // OK right now in libstdc++, fails on libc++ Should we care about those users? --=20 Best regards, Antony Polukhin