From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id E0ADD3858D37 for ; Thu, 1 Dec 2022 04:52:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E0ADD3858D37 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-pf1-x42f.google.com with SMTP id k79so792359pfd.7 for ; Wed, 30 Nov 2022 20:52:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=V5Mja+BZ5ixK3eOj2Ed3YrrS7BOkgfQF9mvwAv7qxjE=; b=gH1fADY5Yo48ZjszLu9LT3d0UUmmPdVJDtf91yTWIJDnIMCJQrEMh0BHRiU3TQofQh Bwpti8B1ciDG4kQT+vZN4EHHFAv6Y7AUBFQM3b0PB5L3KTGW72+AhNXlPh/ArIbNEehz 6c9L7hXvmwMjbMCtVopZQiBVLgjGsdKUVQ4IiOQurUVPwBNOQZHCo4nOKaBQFmCqU7jG UozJ8VQK7K+Bl8DQjW7+3sSI3WhwkHZGGtPs/zfoz/V6f0qQT/vMHANLtWKaSUyKiAtp LJGR03Mazw4HBDhB0eY/DKPrL4MyXKp2DG2YWFc2yMCiBSFJgXeZ16vajzvVwTFrUEgk CFTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=V5Mja+BZ5ixK3eOj2Ed3YrrS7BOkgfQF9mvwAv7qxjE=; b=rVv/1uqexu09axn19guhliFqIpsT44LnsHNFCoujFHeti9D8jn2FwRSdHxsfXGLchM FFB7iH/DZl/2+LOhEg/zsL5KpdVhQvLJj6c7odIPVXqQohnbA1rwSm173R+P/XFeqrOF n4dQG22inl0GIfKnwRzwecp39NkIkf/G0pDkt9hfan232ySi0x//z6W+yKyQtlIiL6XT qxZvlewPpNSevGkX9zBPPf+jy7JiCw5kwcf9UzEJYGp5aGx8esxrfYx2IU3OfTGpNVdy 6QhYUq+KILbW2eVUmaNbaD0rNqBK+gnYV8n2sPufLLMGMc+cNpPziE6e9b20NlxL4sDx NYRg== X-Gm-Message-State: ANoB5pl7Eg8xJRxgStZNzVCB/4psBiQDLrjMR6clET/dfA55X2fZyryH z429B+ubOaDlTmb9H6tlw5WbJZP9Ya/PcJROxDxWWUNDMKA= X-Google-Smtp-Source: AA0mqf6hU2g3CabChALDa6SB9cuQLtULztFq6sOGh6jgga+noQ/siR1YaKU6neFQthCxjl4qDbrn4HXAU7r1eN9xWlI= X-Received: by 2002:aa7:81d8:0:b0:561:c694:80b with SMTP id c24-20020aa781d8000000b00561c694080bmr46050484pfn.47.1669870330618; Wed, 30 Nov 2022 20:52:10 -0800 (PST) MIME-Version: 1.0 From: leon zadorin Date: Thu, 1 Dec 2022 15:51:58 +1100 Message-ID: Subject: which compiler is right (either to compile or to barf)... To: gcc-help Content-Type: multipart/alternative; boundary="000000000000e0acfc05eebcfb72" X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,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: --000000000000e0acfc05eebcfb72 Content-Type: text/plain; charset="UTF-8" Hi everyone, I would be interested to hear the opinions of C++ standard experts on which compiler is correctly dealing with the below code (GCC 12.2 -std=c++20 compiles fine, MSVC19.33 /std:c++20 compiles fine, Clang 15.0.0 -std=c++20 barfs) #include #include #include struct X; template struct J { typedef typename T::x aoeu; }; struct S { ::std::vector<::std::shared_ptr>> v; }; static ::std::optional opt; struct X { typedef int x; }; int main () { } Clang barfs with: incomplete type 'X' named in nested name specifier typedef typename T::x aoeu Interestingly if S::v is not a vector, i.e. instead of ::std::vector<::std::shared_ptr>> v; v is just ::std::shared_ptr> v; ... then clang compiles fine. Also, if optional is replaced with say unique_ptr, clang also builds fine. I would be interested in being educated on the standard (of which I am not a lawyer :) ) what would be the correctly mandated behavior? Kind regards Leon. --000000000000e0acfc05eebcfb72--