rupprecht wrote:
Ok, thanks for the quick confirmation!
https://github.com/llvm/llvm-project/pull/78595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
sdkrystian wrote:
@rupprecht This is intended behavior. We previously did not check qualified
declarations of explicit/partial specializations of class templates for
redundant qualification & invalid nested-name-specifiers (e.g. ones that begin
with `decltype`). We do now, hence the new
rupprecht wrote:
It looks like this caused some new `-Wextra-qualification` warnings
(playground: https://godbolt.org/z/3MbMjGYET)
```
namespace foo {
template
struct Z {};
template <>
struct Z {}; // OK
template <>
struct foo::Z {}; // New warning: extra qualification on member 'Z'
https://github.com/sdkrystian closed
https://github.com/llvm/llvm-project/pull/78595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/sdkrystian updated
https://github.com/llvm/llvm-project/pull/78595
>From 44689d064a5e4c908c0011532302e9b84e060fab Mon Sep 17 00:00:00 2001
From: Krystian Stasiowski
Date: Wed, 17 Jan 2024 10:13:29 -0500
Subject: [PATCH] [Clang][Sema] Diagnose use of template keyword after
https://github.com/erichkeane approved this pull request.
https://github.com/llvm/llvm-project/pull/78595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
sdkrystian wrote:
@erichkeane cor3ntin approved... please take a look when you have time
https://github.com/llvm/llvm-project/pull/78595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/sdkrystian updated
https://github.com/llvm/llvm-project/pull/78595
>From 3c211c6fb78f48dc68634e042e94dbe2f33fb999 Mon Sep 17 00:00:00 2001
From: Krystian Stasiowski
Date: Wed, 17 Jan 2024 10:13:29 -0500
Subject: [PATCH] [Clang][Sema] Diagnose use of template keyword after
https://github.com/cor3ntin approved this pull request.
LGTM, thanks!
https://github.com/llvm/llvm-project/pull/78595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/sdkrystian edited
https://github.com/llvm/llvm-project/pull/78595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
sdkrystian wrote:
@cor3ntin Addressed your comments. I also added the error to a diagnostics
group (`template-in-declaration-name`)
https://github.com/llvm/llvm-project/pull/78595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/sdkrystian updated
https://github.com/llvm/llvm-project/pull/78595
>From 529d16d3509219b9d1cc74c515ec101b1316b6d1 Mon Sep 17 00:00:00 2001
From: Krystian Stasiowski
Date: Wed, 17 Jan 2024 10:13:29 -0500
Subject: [PATCH] [Clang][Sema] Diagnose use of template keyword after
https://github.com/sdkrystian edited
https://github.com/llvm/llvm-project/pull/78595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/sdkrystian updated
https://github.com/llvm/llvm-project/pull/78595
>From ba33d31a3029ab538ae5ddc61609b848ee1261d4 Mon Sep 17 00:00:00 2001
From: Krystian Stasiowski
Date: Wed, 17 Jan 2024 10:13:29 -0500
Subject: [PATCH] [Clang][Sema] Diagnose use of template keyword after
@@ -4394,8 +4394,14 @@ NestedNameSpecifierLoc
TreeTransform::TransformNestedNameSpecifierLoc(
SS.Adopt(ETL.getQualifierLoc());
TL = ETL.getNamedTypeLoc();
}
-SS.Extend(SemaRef.Context, /*FIXME:*/ SourceLocation(), TL,
-
@@ -3,21 +3,21 @@ template // expected-note{{previous
template}}
class X0 {
public:
typedef int size_type;
-
+
X0(int);
~X0();
-
+
void f0(const T&, const U&);
-
+
T& operator[](int i) const;
-
+
void f1(size_type) const;
void f2(size_type) const;
@@ -6327,12 +6331,42 @@ bool Sema::diagnoseQualifiedDeclaration(CXXScopeSpec
, DeclContext *DC,
return false;
}
+ // C++23 [temp.names]p5:
+ // The keyword template shall not appear immediately after a declarative
+ // nested-name-specifier.
+ if (TemplateId &&
@@ -3,21 +3,21 @@ template // expected-note{{previous
template}}
class X0 {
public:
typedef int size_type;
-
+
X0(int);
~X0();
-
+
void f0(const T&, const U&);
-
+
T& operator[](int i) const;
-
+
void f1(size_type) const;
void f2(size_type) const;
@@ -4394,8 +4394,14 @@ NestedNameSpecifierLoc
TreeTransform::TransformNestedNameSpecifierLoc(
SS.Adopt(ETL.getQualifierLoc());
TL = ETL.getNamedTypeLoc();
}
-SS.Extend(SemaRef.Context, /*FIXME:*/ SourceLocation(), TL,
-
@@ -6327,12 +6331,42 @@ bool Sema::diagnoseQualifiedDeclaration(CXXScopeSpec
, DeclContext *DC,
return false;
}
+ // C++23 [temp.names]p5:
+ // The keyword template shall not appear immediately after a declarative
+ // nested-name-specifier.
+ if (TemplateId &&
https://github.com/sdkrystian updated
https://github.com/llvm/llvm-project/pull/78595
>From 75524a1f443c86787f0605d7890a1caa01c5ebf5 Mon Sep 17 00:00:00 2001
From: Krystian Stasiowski
Date: Wed, 17 Jan 2024 10:13:29 -0500
Subject: [PATCH 1/2] [Clang][Sema] Diagnose use of template keyword
sdkrystian wrote:
@cor3ntin I changed the diagnostic to a pedantic warning and added a release
note.
> I wonder if we should add tests for
> https://cplusplus.github.io/CWG/issues/1707.html in this patch.
We don't check for the template keyword when parsing an
_elaborated-type-specifier_
https://github.com/sdkrystian updated
https://github.com/llvm/llvm-project/pull/78595
>From f72b5e65817e9c25ec0fcabbf0a6bf684066a046 Mon Sep 17 00:00:00 2001
From: Krystian Stasiowski
Date: Wed, 17 Jan 2024 10:13:29 -0500
Subject: [PATCH 1/2] [Clang][Sema] Diagnose use of template keyword
https://github.com/sdkrystian updated
https://github.com/llvm/llvm-project/pull/78595
>From f72b5e65817e9c25ec0fcabbf0a6bf684066a046 Mon Sep 17 00:00:00 2001
From: Krystian Stasiowski
Date: Wed, 17 Jan 2024 10:13:29 -0500
Subject: [PATCH] [Clang][Sema] Diagnose use of template keyword after
https://github.com/sdkrystian updated
https://github.com/llvm/llvm-project/pull/78595
>From c07119d8e85e4bd9849e8d0b5dc8edb5384d9b91 Mon Sep 17 00:00:00 2001
From: Krystian Stasiowski
Date: Wed, 17 Jan 2024 10:13:29 -0500
Subject: [PATCH] [Clang][Sema] Diagnose use of template keyword after
@@ -182,8 +182,8 @@ struct Bad2 { int a, b; };
} // namespace dr2386
namespace std {
template struct tuple_size;
-template <> struct std::tuple_size {};
sdkrystian wrote:
It is, yes
https://github.com/llvm/llvm-project/pull/78595
https://github.com/Endilll edited
https://github.com/llvm/llvm-project/pull/78595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -182,8 +182,8 @@ struct Bad2 { int a, b; };
} // namespace dr2386
namespace std {
template struct tuple_size;
-template <> struct std::tuple_size {};
Endilll wrote:
Is this warning emitted if we spell it `::std::tuple)size`?
sdkrystian wrote:
@cor3ntin Pedantic warning would probably be best as other implementations are
not great at diagnosing this
https://github.com/llvm/llvm-project/pull/78595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -182,8 +182,8 @@ struct Bad2 { int a, b; };
} // namespace dr2386
namespace std {
template struct tuple_size;
-template <> struct std::tuple_size {};
sdkrystian wrote:
@Endilll if left unchanged this will result in a warning about redundant
cor3ntin wrote:
Thank for this patch
I think this might be better done as a pedantic warning.
IE, I am concerned that this could break existing code, similarly to
https://github.com/llvm/llvm-project/issues/78031#issuecomment-1891475606
I wonder if we should add tests for
@@ -182,8 +182,8 @@ struct Bad2 { int a, b; };
} // namespace dr2386
namespace std {
template struct tuple_size;
-template <> struct std::tuple_size {};
Endilll wrote:
Is this a really necessary change?
https://github.com/llvm/llvm-project/pull/78595
https://github.com/sdkrystian edited
https://github.com/llvm/llvm-project/pull/78595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
33 matches
Mail list logo