From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 5C8A3383B6B5 for ; Tue, 6 Dec 2022 20:37:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5C8A3383B6B5 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x630.google.com with SMTP id x22so9176359ejs.11 for ; Tue, 06 Dec 2022 12:37:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=aNbSX7Q+iQnpFmX7vqrs+yKhpkkCX8L12jBVYjHp5o0=; b=V82q7nI8cHYYWitHEarX6MOe5+NPDmy8pHxnYMY+jK3YQQAtFwe/yy4VcKvGIx9uLF 93Oxd53OvBYKfL8R8Ic8jKqE2PG5SkjY/Z3ShOoO9DX+gEO/RESEivRbrH0c2QdcMcwv m7+ipgtyKTnqs95IaAoPd4w4MgG3AYjrl5LCQ/a5qk/vHHuiHQM+XFnNfyUMLkv8Sstd KNAMteh7eTrSt09SsuBMkdOsVHzd60BrhY+JnKvDChFyY1aMVegF3JR5nWjJSZk48Zga /pSfDklB+GlDRYhbFkQg7A9xVIk0LroqmI89UaGNw68m6o934IkHsPFFpnGQ0OAAYfEt e4dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aNbSX7Q+iQnpFmX7vqrs+yKhpkkCX8L12jBVYjHp5o0=; b=S4mdPTdHLZOAaCblA0JVstPGCqvjm5N20EnoF+a0DWpPPk4aEqA1A370AVH8n7+Bpe FP0PVzh8P7dq4PFlikrss5naygTKJ6zruogpZk6iEqMwUyHMA0/+xgx48kRy0cyGHeaT 0omgLGPtcQkpMCk7/aF+kYMTioOicDM29cgtT7+F9wBUYjqVbrchbcsIgSS5G5OZ0uqx ksW+lFFZXyKpSpdHvrrtYegI7Uu8PZLNlCDu1oj0sdcFB5VUVyV/mVFH94qQiYo6mesp +7RR1ay5JvVFAJrV7CEA26FttzSrvHdOoUlhmnKwxBGM++KgLFy31rfH/5QLqYTXLtXr yGPQ== X-Gm-Message-State: ANoB5pnOU5+TWrpwxXd6gQGOQiO5D6SAxUrJAsveHaDPyOzOO/Hhwk5r c8n27/hDsQu2JJqGJGGQ2KacOvQvnBYjToab3tc= X-Google-Smtp-Source: AA0mqf6/oRWTW8E5wNBpG6a3leZnKJ+W5JjtPwh6tdEuCOhszGGM3UKam81tDEWd4MZu+DXKWX7TAR5+3QBs2ucZoA0= X-Received: by 2002:a17:906:518c:b0:7c1:98f:c16a with SMTP id y12-20020a170906518c00b007c1098fc16amr4445873ejk.215.1670359020053; Tue, 06 Dec 2022 12:37:00 -0800 (PST) MIME-Version: 1.0 References: <52ab45bc-cd6e-7acb-dc6f-9cddef4a926a@codesourcery.com> In-Reply-To: From: Jonathan Wakely Date: Tue, 6 Dec 2022 20:36:46 +0000 Message-ID: Subject: Re: Using [[may_alias]] in C23/C++23 on a union works in neither post-"union" position, or at the end of the definition To: Gavin Ray Cc: Joseph Myers , "gcc@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.6 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, 6 Dec 2022 at 20:32, Gavin Ray wrote: > > Ah got it, didn't know that (handy, will save me duplicating a bunch of attributes). > Thanks Jonathan! The Clang doc acually show all the forms that can be used for each attribute: https://clang.llvm.org/docs/AttributeReference.html#may-alias "GNU" means __attribute__((may_alias)) and the C++11 and C2x columns show that [[gnu::may_alias]] is the right way to use it. Clang-specific attributes use clang:: instead e.g. https://clang.llvm.org/docs/AttributeReference.html#preserve-all