From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27461 invoked by alias); 2 Jul 2019 07:47:36 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 27453 invoked by uid 89); 2 Jul 2019 07:47:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:298, Grant X-HELO: mail-wr1-f52.google.com Received: from mail-wr1-f52.google.com (HELO mail-wr1-f52.google.com) (209.85.221.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 02 Jul 2019 07:47:35 +0000 Received: by mail-wr1-f52.google.com with SMTP id c27so8862731wrb.2 for ; Tue, 02 Jul 2019 00:47:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sK2uLUNULNQk4SkqnqRze/JcbVEJL2wWbJ2NaUirg/s=; b=INf7Lxl+IySgrsX9doYgLOa+zrule+hUvUcxigyc0X6TxLNCVRdNoAsMP2Vly8Q7WR khGqVdQ7jH9mt/0WtZhuLx3hKFAmJKOD6WtwcDvcmaaQAxatWyY+5rhvh/PV+xJXHpBX 6DlAwFvgBK3rMKJFK5pArUA3N97QLD/ARQpdis2hUu7slb5zF3FJo3A0D9z05n4rRr05 PQkLQSABAYuYQJLysHjyXc952/cqK07C1qzrk2uDFpRJ1Byu4T63+zycQ6VNnn8K2SR5 BfLH5buHmTNZ1M8GjPUsZytRshJJkCm2/iEQY0n0jsgAdqbvsYFpacdXD8I7A0ie2G/P dCIw== MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Tue, 02 Jul 2019 07:47:00 -0000 Message-ID: Subject: Re: gcc warn C++ implicit enum conversion To: Jonny Grant Cc: gcc-help Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00022.txt.bz2 On Mon, 1 Jul 2019 at 23:40, Jonny Grant wrote: > > Hi > Is there any way to warn on enum conversion to int? I don't think so. I'd just use 'enum class' so the conversion is forbidden, and insert explicit casts where you want the conversion to compile.