From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50003 invoked by alias); 19 May 2017 19:32:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 49982 invoked by uid 89); 19 May 2017 19:32:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.2 spammy= X-HELO: mail-it0-f43.google.com Received: from mail-it0-f43.google.com (HELO mail-it0-f43.google.com) (209.85.214.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 May 2017 19:32:00 +0000 Received: by mail-it0-f43.google.com with SMTP id e65so52364558ita.1 for ; Fri, 19 May 2017 12:32:03 -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:from:date:message-id:subject:to:cc; bh=HbBru0YhWzEYiM9djx/D2GWT+E5/viyirtvcUHblk+o=; b=OC0uBzPZUhge4tGdqbbSHqvbgNjzomTl2tWLjW1EWLGtRS4AYbkjJGAxBgHnorAzrF IY3AjumxiugA4VNNMmX1SkcmTD2LmhOQ8Mzsn8LMNkHxYdpgZcbbEG23fcoM+Mdg5RNL uXu4k+9hhP3mjFpZBwICxJxrQUnFcR6lUFEdQE3FaoUKNKxgi64l6aQQSbCSBYvsy/fl c446lNW9Cy5mYKee+UJ8Y1ZHlzVaCbANj6W/3luZlBybdbXqx7h4uZhdexrDw3ayMxAV uO0YB9V65kMJ22D+rhj0MbPowy3cNm6zZyDcKstBMjwujewC0XVcm9tRRnFfpb+g3HSh mRcA== X-Gm-Message-State: AODbwcD6KQ7AzTs0xDpi6EzvrgqqRA9FAinJ5a5A8C+Ro2GGwxbopzYr /xlTKgKPW5Or51SivEJ0LuGfWGCDCaTJ X-Received: by 10.36.173.70 with SMTP id a6mr29628109itj.110.1495222321945; Fri, 19 May 2017 12:32:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.6.226 with HTTP; Fri, 19 May 2017 12:31:41 -0700 (PDT) From: Jason Merrill Date: Fri, 19 May 2017 19:39:00 -0000 Message-ID: Subject: c-warn PATCH to silence warnings about std::byte in switch To: gcc-patches List Cc: "Joseph S. Myers" Content-Type: multipart/mixed; boundary="94eb2c1fc29c5c78f0054fe59396" X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg01611.txt.bz2 --94eb2c1fc29c5c78f0054fe59396 Content-Type: text/plain; charset="UTF-8" Content-length: 397 It doesn't make sense to warn about a switch case not being an enumerator if the enum type has no enumerators; such a type is being used as an opaque typedef rather than a true enumerated type. This usage makes more sense with C++11 enums with explicitly specified underlying type, but I don't think it's necessary to limit the patch to that case. Tested x86_64-pc-linux-gnu, applying to trunk. --94eb2c1fc29c5c78f0054fe59396 Content-Type: text/plain; charset="US-ASCII"; name="byte-case.diff" Content-Disposition: attachment; filename="byte-case.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j2w8ndxs0 Content-length: 1652 Y29tbWl0IDY3MzI2NWMzZDRjZDc3YzdiMGU5MjdjYzE1NDc0NDRlZjg2OWFk M2EKQXV0aG9yOiBKYXNvbiBNZXJyaWxsIDxqYXNvbkByZWRoYXQuY29tPgpE YXRlOiAgIFRodSBNYXkgMTggMjI6NDU6MjQgMjAxNyAtMDQwMAoKICAgICAg ICAgICAgKiBjLXdhcm4uYyAobWF0Y2hfY2FzZV90b19lbnVtXzEpOiBEb24n dCB3YXJuIGFib3V0IGVudW1zIHdpdGggbm8KICAgICAgICAgICAgZW51bWVy YXRvcnMuCgpkaWZmIC0tZ2l0IGEvZ2NjL2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