[PATCH] D120639: [RISCV] Pass -mno-relax to assembler when -fno-integrated-as specified

2022-04-17 Thread luxufan via Phabricator via cfe-commits
StephenFan added a comment.

Thanks @MaskRay, @asb !


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120639/new/

https://reviews.llvm.org/D120639

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D120639: [RISCV] Pass -mno-relax to assembler when -fno-integrated-as specified

2022-04-17 Thread luxufan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG429cbac03906: [RISCV] Pass -mno-relax to assembler when 
-fno-integrated-as specified (authored by StephenFan).

Changed prior to commit:
  https://reviews.llvm.org/D120639?vs=418774=423327#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120639/new/

https://reviews.llvm.org/D120639

Files:
  clang/lib/Driver/ToolChains/Gnu.cpp
  clang/test/Driver/riscv-gnutools.c


Index: clang/test/Driver/riscv-gnutools.c
===
--- clang/test/Driver/riscv-gnutools.c
+++ clang/test/Driver/riscv-gnutools.c
@@ -16,9 +16,14 @@
 // RUN: %clang --target=riscv32-unknown-elf 
--gcc-toolchain=%S/Inputs/basic_riscv32_tree -fno-integrated-as %s -### -c 
-march=rv32g \
 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32G-ILP32D %s
 
+// Check -mno-relax is passed when -fno-integrated-as specified
+// RUN: %clang -target riscv32-unknown-elf 
--gcc-toolchain=%S/Inputs/basic_riscv32_tree -mno-relax -fno-integrated-as %s 
-### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32-NO-RELAX %s
+
 // CHECK-RV32IMAC-ILP32: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32" "-march" 
"rv32imac"
 // CHECK-RV32IMAFDC-ILP32D: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32d" "-march" 
"rv32imafdc"
 // CHECK-RV32G-ILP32D: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32d" "-march" "rv32g"
+// CHECK-RV32-NO-RELAX: "{{.*}}as{{(.exe)?}}" "{{.*}}" "-mno-relax"
 
 
 // 64-bit checks
@@ -35,6 +40,12 @@
 // RUN: %clang --target=riscv64-unknown-elf 
--gcc-toolchain=%S/Inputs/basic_riscv64_tree -fno-integrated-as %s -### -c 
-march=rv64g \
 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64G-LP64D %s
 
+// Check -mno-relax is not passed when -fno-integrated-as specified
+// RUN: %clang -target riscv64-unknown-elf 
--gcc-toolchain=%S/Inputs/basic_riscv64_tree -mno-relax -mrelax 
-fno-integrated-as %s -### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64-RELAX %s
+
 // CHECK-RV64IMAC-LP64: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64" "-march" 
"rv64imac"
 // CHECK-RV64IMAFDC-LP64D: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64d" "-march" 
"rv64imafdc"
 // CHECK-RV64G-LP64D: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64d" "-march" "rv64g"
+// CHECK-RV64-RELAX: "{{.*}}as{{(.exe)?}}"
+// CHECK-RV64-RELAX-NOT: "-mno-relax"
Index: clang/lib/Driver/ToolChains/Gnu.cpp
===
--- clang/lib/Driver/ToolChains/Gnu.cpp
+++ clang/lib/Driver/ToolChains/Gnu.cpp
@@ -764,6 +764,8 @@
 StringRef MArchName = riscv::getRISCVArch(Args, 
getToolChain().getTriple());
 CmdArgs.push_back("-march");
 CmdArgs.push_back(MArchName.data());
+if (!Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, true))
+  Args.addOptOutFlag(CmdArgs, options::OPT_mrelax, options::OPT_mno_relax);
 break;
   }
   case llvm::Triple::sparc:


Index: clang/test/Driver/riscv-gnutools.c
===
--- clang/test/Driver/riscv-gnutools.c
+++ clang/test/Driver/riscv-gnutools.c
@@ -16,9 +16,14 @@
 // RUN: %clang --target=riscv32-unknown-elf --gcc-toolchain=%S/Inputs/basic_riscv32_tree -fno-integrated-as %s -### -c -march=rv32g \
 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32G-ILP32D %s
 
+// Check -mno-relax is passed when -fno-integrated-as specified
+// RUN: %clang -target riscv32-unknown-elf --gcc-toolchain=%S/Inputs/basic_riscv32_tree -mno-relax -fno-integrated-as %s -### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32-NO-RELAX %s
+
 // CHECK-RV32IMAC-ILP32: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32" "-march" "rv32imac"
 // CHECK-RV32IMAFDC-ILP32D: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32d" "-march" "rv32imafdc"
 // CHECK-RV32G-ILP32D: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32d" "-march" "rv32g"
+// CHECK-RV32-NO-RELAX: "{{.*}}as{{(.exe)?}}" "{{.*}}" "-mno-relax"
 
 
 // 64-bit checks
@@ -35,6 +40,12 @@
 // RUN: %clang --target=riscv64-unknown-elf --gcc-toolchain=%S/Inputs/basic_riscv64_tree -fno-integrated-as %s -### -c -march=rv64g \
 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64G-LP64D %s
 
+// Check -mno-relax is not passed when -fno-integrated-as specified
+// RUN: %clang -target riscv64-unknown-elf --gcc-toolchain=%S/Inputs/basic_riscv64_tree -mno-relax -mrelax -fno-integrated-as %s -### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64-RELAX %s
+
 // CHECK-RV64IMAC-LP64: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64" "-march" "rv64imac"
 // CHECK-RV64IMAFDC-LP64D: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64d" "-march" "rv64imafdc"
 // CHECK-RV64G-LP64D: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64d" "-march" "rv64g"
+// CHECK-RV64-RELAX: "{{.*}}as{{(.exe)?}}"
+// CHECK-RV64-RELAX-NOT: "-mno-relax"
Index: clang/lib/Driver/ToolChains/Gnu.cpp
===
--- clang/lib/Driver/ToolChains/Gnu.cpp
+++ 

[clang] 429cbac - [RISCV] Pass -mno-relax to assembler when -fno-integrated-as specified

2022-04-17 Thread via cfe-commits

Author: luxufan
Date: 2022-04-18T11:16:41+08:00
New Revision: 429cbac0390654f90bba18a41799464adf31a5ec

URL: 
https://github.com/llvm/llvm-project/commit/429cbac0390654f90bba18a41799464adf31a5ec
DIFF: 
https://github.com/llvm/llvm-project/commit/429cbac0390654f90bba18a41799464adf31a5ec.diff

LOG: [RISCV] Pass -mno-relax to assembler when -fno-integrated-as specified

In the past, `clang --target=riscv64-unknown-linux-gnu -mno-relax -c hello.s` 
will assemble hello.s without relaxation, but `clang 
--target=riscv64-unknown-linux-gnu -mno-relax -fno-integrated-as -c hello.s` 
doesn't pass the `-mno-relax` option to assembler, and assemble with relaxation
This patch pass the -mno-relax option to assembler when -fno-integrated-as is 
specified.

Differential Revision: https://reviews.llvm.org/D120639

Added: 


Modified: 
clang/lib/Driver/ToolChains/Gnu.cpp
clang/test/Driver/riscv-gnutools.c

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/Gnu.cpp 
b/clang/lib/Driver/ToolChains/Gnu.cpp
index ae848cfe81c93..5816b91994102 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -764,6 +764,8 @@ void tools::gnutools::Assembler::ConstructJob(Compilation 
,
 StringRef MArchName = riscv::getRISCVArch(Args, 
getToolChain().getTriple());
 CmdArgs.push_back("-march");
 CmdArgs.push_back(MArchName.data());
+if (!Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, true))
+  Args.addOptOutFlag(CmdArgs, options::OPT_mrelax, options::OPT_mno_relax);
 break;
   }
   case llvm::Triple::sparc:

diff  --git a/clang/test/Driver/riscv-gnutools.c 
b/clang/test/Driver/riscv-gnutools.c
index 2b44494336d59..685b320149df9 100644
--- a/clang/test/Driver/riscv-gnutools.c
+++ b/clang/test/Driver/riscv-gnutools.c
@@ -16,9 +16,14 @@
 // RUN: %clang --target=riscv32-unknown-elf 
--gcc-toolchain=%S/Inputs/basic_riscv32_tree -fno-integrated-as %s -### -c 
-march=rv32g \
 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32G-ILP32D %s
 
+// Check -mno-relax is passed when -fno-integrated-as specified
+// RUN: %clang -target riscv32-unknown-elf 
--gcc-toolchain=%S/Inputs/basic_riscv32_tree -mno-relax -fno-integrated-as %s 
-### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32-NO-RELAX %s
+
 // CHECK-RV32IMAC-ILP32: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32" "-march" 
"rv32imac"
 // CHECK-RV32IMAFDC-ILP32D: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32d" "-march" 
"rv32imafdc"
 // CHECK-RV32G-ILP32D: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32d" "-march" "rv32g"
+// CHECK-RV32-NO-RELAX: "{{.*}}as{{(.exe)?}}" "{{.*}}" "-mno-relax"
 
 
 // 64-bit checks
@@ -35,6 +40,12 @@
 // RUN: %clang --target=riscv64-unknown-elf 
--gcc-toolchain=%S/Inputs/basic_riscv64_tree -fno-integrated-as %s -### -c 
-march=rv64g \
 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64G-LP64D %s
 
+// Check -mno-relax is not passed when -fno-integrated-as specified
+// RUN: %clang -target riscv64-unknown-elf 
--gcc-toolchain=%S/Inputs/basic_riscv64_tree -mno-relax -mrelax 
-fno-integrated-as %s -### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64-RELAX %s
+
 // CHECK-RV64IMAC-LP64: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64" "-march" 
"rv64imac"
 // CHECK-RV64IMAFDC-LP64D: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64d" "-march" 
"rv64imafdc"
 // CHECK-RV64G-LP64D: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64d" "-march" "rv64g"
+// CHECK-RV64-RELAX: "{{.*}}as{{(.exe)?}}"
+// CHECK-RV64-RELAX-NOT: "-mno-relax"



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] 3eeca52 - Fix wrong signature for std::move and std::swap in test.

2022-04-17 Thread Richard Smith via cfe-commits

Author: Richard Smith
Date: 2022-04-17T19:25:20-07:00
New Revision: 3eeca524569744d2927fd13304ab5abb7217e108

URL: 
https://github.com/llvm/llvm-project/commit/3eeca524569744d2927fd13304ab5abb7217e108
DIFF: 
https://github.com/llvm/llvm-project/commit/3eeca524569744d2927fd13304ab5abb7217e108.diff

LOG: Fix wrong signature for std::move and std::swap in test.

Added: 


Modified: 

clang-tools-extra/test/clang-tidy/checkers/bugprone-unhandled-self-assignment.cpp

Removed: 




diff  --git 
a/clang-tools-extra/test/clang-tidy/checkers/bugprone-unhandled-self-assignment.cpp
 
b/clang-tools-extra/test/clang-tidy/checkers/bugprone-unhandled-self-assignment.cpp
index fb7c089ae8cd6..14d27855d7c5a 100644
--- 
a/clang-tools-extra/test/clang-tidy/checkers/bugprone-unhandled-self-assignment.cpp
+++ 
b/clang-tools-extra/test/clang-tidy/checkers/bugprone-unhandled-self-assignment.cpp
@@ -3,11 +3,11 @@
 namespace std {
 
 template 
-void swap(T x, T y) {
+void swap(T , T ) {
 }
 
 template 
-T &(T x) {
+T &(T ) {
 }
 
 template 
@@ -403,7 +403,7 @@ class CopyAndMove1 {
 class CopyAndMove2 {
 public:
   CopyAndMove2 =(const CopyAndMove2 ) {
-*this = std::move(CopyAndMove2(object));
+*this = CopyAndMove2(object);
 return *this;
   }
 



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123345: Treat `std::move`, `forward`, and `move_if_noexcept` as builtins.

2022-04-17 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb27430f9f46b: Treat `std::move`, `forward`, etc. as 
builtins. (authored by rsmith).

Changed prior to commit:
  https://reviews.llvm.org/D123345?vs=423165=423312#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123345/new/

https://reviews.llvm.org/D123345

Files:
  clang/docs/CommandGuide/clang.rst
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/Builtins.def
  clang/include/clang/Basic/Builtins.h
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/AST/ExprConstant.cpp
  clang/lib/Analysis/BodyFarm.cpp
  clang/lib/Basic/Builtins.cpp
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/Sema/SemaChecking.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/SemaExprCXX.cpp
  clang/lib/Sema/SemaInit.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
  clang/test/Analysis/inner-pointer.cpp
  clang/test/Analysis/use-after-move.cpp
  clang/test/CodeGenCXX/builtin-std-move.cpp
  clang/test/CodeGenCXX/builtins.cpp
  clang/test/CodeGenCXX/microsoft-abi-throw.cpp
  clang/test/SemaCXX/builtin-std-move-nobuiltin.cpp
  clang/test/SemaCXX/builtin-std-move.cpp
  clang/test/SemaCXX/unqualified-std-call-fixits.cpp
  clang/test/SemaCXX/unqualified-std-call.cpp
  clang/test/SemaCXX/warn-consumed-analysis.cpp
  clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp

Index: clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp
===
--- clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp
+++ clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp
@@ -1444,7 +1444,7 @@
 TEST(ExprMutationAnalyzerTest, ReproduceFailureMinimal) {
   const std::string Reproducer =
   "namespace std {"
-  "template  T forward(T & A) { return static_cast(A); }"
+  "template  T (T ) { return static_cast(A); }"
   "template  struct __bind {"
   "  T f;"
   "  template  __bind(T v, V &&) : f(forward(v)) {}"
Index: clang/test/SemaCXX/warn-consumed-analysis.cpp
===
--- clang/test/SemaCXX/warn-consumed-analysis.cpp
+++ clang/test/SemaCXX/warn-consumed-analysis.cpp
@@ -953,12 +953,12 @@
 namespace std {
   void move();
   template
-  void move(T&&);
+  T &(T&);
 
   namespace __1 {
 void move();
 template
-void move(T&&);
+T &(T&);
   }
 }
 
@@ -971,7 +971,7 @@
   void test() {
 x.move();
 std::move();
-std::move(x);
+std::move(x); // expected-warning {{ignoring return value}}
 std::__1::move();
 std::__1::move(x);
   }
Index: clang/test/SemaCXX/unqualified-std-call.cpp
===
--- clang/test/SemaCXX/unqualified-std-call.cpp
+++ clang/test/SemaCXX/unqualified-std-call.cpp
@@ -1,17 +1,17 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wall -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wall -std=c++11 %s -Wno-unused-value
 
 namespace std {
 
 template 
 void dummy(T &&) {}
 template 
-void move(T &&) {}
+T &(T &) { return x; }
 template 
 void move(T &&, U &&) {}
 
 inline namespace __1 {
 template 
-void forward(T &) {}
+T (T ) { return x; }
 } // namespace __1
 
 struct foo {};
Index: clang/test/SemaCXX/unqualified-std-call-fixits.cpp
===
--- clang/test/SemaCXX/unqualified-std-call-fixits.cpp
+++ clang/test/SemaCXX/unqualified-std-call-fixits.cpp
@@ -6,9 +6,9 @@
 
 namespace std {
 
-void move(auto &) {}
+int &(auto &) { return a; }
 
-void forward(auto ) {}
+int &(auto ) { return a; }
 
 } // namespace std
 
@@ -16,8 +16,8 @@
 
 void f() {
   int i = 0;
-  move(i); // expected-warning {{unqualified call to std::move}}
-  // CHECK: {{^}}  std::
-  forward(i); // expected-warning {{unqualified call to std::forward}}
-  // CHECK: {{^}}  std::
+  (void)move(i); // expected-warning {{unqualified call to std::move}}
+  // CHECK: {{^}}  (void)std::move
+  (void)forward(i); // expected-warning {{unqualified call to std::forward}}
+  // CHECK: {{^}}  (void)std::forward
 }
Index: clang/test/SemaCXX/builtin-std-move.cpp
===
--- /dev/null
+++ clang/test/SemaCXX/builtin-std-move.cpp
@@ -0,0 +1,126 @@
+// RUN: %clang_cc1 -std=c++17 -verify %s
+// RUN: %clang_cc1 -std=c++17 -verify %s -DNO_CONSTEXPR
+// RUN: %clang_cc1 -std=c++20 -verify %s
+
+namespace std {
+#ifndef NO_CONSTEXPR
+#define CONSTEXPR constexpr
+#else
+#define CONSTEXPR
+#endif
+
+  template CONSTEXPR T &(T ) {
+static_assert(T::moveable, "instantiated move"); // expected-error {{no member named 'moveable' in 'B'}}
+ // expected-error@-1 {{no member named 'moveable' in 'C'}}
+return static_cast(x);
+  }
+
+  

[clang] b27430f - Treat `std::move`, `forward`, etc. as builtins.

2022-04-17 Thread Richard Smith via cfe-commits

Author: Richard Smith
Date: 2022-04-17T13:26:16-07:00
New Revision: b27430f9f46b88bcd54d992debc8d72e131e1bd0

URL: 
https://github.com/llvm/llvm-project/commit/b27430f9f46b88bcd54d992debc8d72e131e1bd0
DIFF: 
https://github.com/llvm/llvm-project/commit/b27430f9f46b88bcd54d992debc8d72e131e1bd0.diff

LOG: Treat `std::move`, `forward`, etc. as builtins.

This is extended to all `std::` functions that take a reference to a
value and return a reference (or pointer) to that same value: `move`,
`forward`, `move_if_noexcept`, `as_const`, `addressof`, and the
libstdc++-specific function `__addressof`.

We still require these functions to be declared before they can be used,
but don't instantiate their definitions unless their addresses are
taken. Instead, code generation, constant evaluation, and static
analysis are given direct knowledge of their effect.

This change aims to reduce various costs associated with these functions
-- per-instantiation memory costs, compile time and memory costs due to
creating out-of-line copies and inlining them, code size at -O0, and so
on -- so that they are not substantially more expensive than a cast.
Most of these improvements are very small, but I measured a 3% decrease
in -O0 object file size for a simple C++ source file using the standard
library after this change.

We now automatically infer the `const` and `nothrow` attributes on these
now-builtin functions, in particular meaning that we get a warning for
an unused call to one of these functions.

In C++20 onwards, we disallow taking the addresses of these functions,
per the C++20 "addressable function" rule. In earlier language modes, a
compatibility warning is produced but the address can still be taken.

The same infrastructure is extended to the existing MSVC builtin
`__GetExceptionInfo`, which is now only recognized in namespace `std`
like it always should have been.

This is a re-commit of
  fc3090109643af8d2da9822d0f99c84742b9c877,
  a571f82a50416b767fd3cce0fb5027bb5dfec58c, and
  64c045e25b8471bbb572bd29159c294a82a86a25
which were reverted in
  e75d8b70370435b0ad10388afba0df45fcf9bfcc
due to a crasher bug where CodeGen would emit a builtin glvalue as an
rvalue if it constant-folds.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D123345

Added: 
clang/test/CodeGenCXX/builtin-std-move.cpp
clang/test/SemaCXX/builtin-std-move-nobuiltin.cpp
clang/test/SemaCXX/builtin-std-move.cpp

Modified: 
clang/docs/CommandGuide/clang.rst
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/Builtins.def
clang/include/clang/Basic/Builtins.h
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/AST/ExprConstant.cpp
clang/lib/Analysis/BodyFarm.cpp
clang/lib/Basic/Builtins.cpp
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/CodeGen/CGCall.cpp
clang/lib/Sema/SemaChecking.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/lib/Sema/SemaInit.cpp
clang/lib/Sema/SemaOverload.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/test/Analysis/inner-pointer.cpp
clang/test/Analysis/use-after-move.cpp
clang/test/CodeGenCXX/builtins.cpp
clang/test/CodeGenCXX/microsoft-abi-throw.cpp
clang/test/SemaCXX/unqualified-std-call-fixits.cpp
clang/test/SemaCXX/unqualified-std-call.cpp
clang/test/SemaCXX/warn-consumed-analysis.cpp
clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp

Removed: 




diff  --git a/clang/docs/CommandGuide/clang.rst 
b/clang/docs/CommandGuide/clang.rst
index aec62789a43e6..658a30458043e 100644
--- a/clang/docs/CommandGuide/clang.rst
+++ b/clang/docs/CommandGuide/clang.rst
@@ -252,8 +252,24 @@ Language Selection and Mode Options
 
 .. option:: -fno-builtin
 
- Disable special handling and optimizations of builtin functions like
- :c:func:`strlen` and :c:func:`malloc`.
+ Disable special handling and optimizations of well-known library functions,
+ like :c:func:`strlen` and :c:func:`malloc`.
+
+.. option:: -fno-builtin-
+
+ Disable special handling and optimizations for the specific library function.
+ For example, ``-fno-builtin-strlen`` removes any special handling for the
+ :c:func:`strlen` library function.
+
+.. option:: -fno-builtin-std-
+
+ Disable special handling and optimizations for the specific C++ standard
+ library function in namespace ``std``. For example,
+ ``-fno-builtin-std-move_if_noexcept`` removes any special handling for the
+ :cpp:func:`std::move_if_noexcept` library function.
+
+ For C standard library functions that the C++ standard library also provides
+ in namespace ``std``, use :option:`-fno-builtin-\` instead.
 
 .. option:: -fmath-errno
 

diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index c72028c718586..2aabeaf6d679f 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -230,7 

[PATCH] D122255: Meta directive runtime support

2022-04-17 Thread Abid via Phabricator via cfe-commits
abidmalikwaterloo updated this revision to Diff 423305.
abidmalikwaterloo added a comment.

Cleaned the code and added tests.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122255/new/

https://reviews.llvm.org/D122255

Files:
  clang/include/clang/AST/OpenMPClause.h
  clang/include/clang/AST/RecursiveASTVisitor.h
  clang/include/clang/AST/StmtOpenMP.h
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/include/clang/Parse/Parser.h
  clang/include/clang/Sema/Sema.h
  clang/lib/AST/OpenMPClause.cpp
  clang/lib/AST/StmtPrinter.cpp
  clang/lib/Parse/ParseOpenMP.cpp
  clang/lib/Sema/SemaOpenMP.cpp
  clang/lib/Sema/SemaStmt.cpp
  clang/test/OpenMP/metadirective_ast_print_new_1.cpp
  clang/test/OpenMP/metadirective_ast_print_new_2.cpp
  clang/test/OpenMP/metadirective_ast_print_new_3.cpp
  llvm/include/llvm/Frontend/OpenMP/OMPContext.h
  llvm/lib/Frontend/OpenMP/OMPContext.cpp

Index: llvm/lib/Frontend/OpenMP/OMPContext.cpp
===
--- llvm/lib/Frontend/OpenMP/OMPContext.cpp
+++ llvm/lib/Frontend/OpenMP/OMPContext.cpp
@@ -20,6 +20,7 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 
+#include 
 #define DEBUG_TYPE "openmp-ir-builder"
 
 using namespace llvm;
@@ -339,6 +340,41 @@
   return Score;
 }
 
+/// Takes \p VMI and \p Ctx and sort the 
+/// scores using \p A
+void llvm::omp::getArrayVariantMatchForContext(const SmallVectorImpl ,
+const OMPContext , SmallVector> ){
+	
+//APInt BestScore(64, 0);
+APInt Score (64, 0);
+llvm::DenseMap m;
+		
+for (unsigned u = 0, e = VMIs.size(); u < e; ++u) {
+  const VariantMatchInfo  = VMIs[u];
+
+  SmallVector ConstructMatches;
+  // If the variant is not applicable its not the best.
+  if (!isVariantApplicableInContextHelper(VMI, Ctx, ,
+   /* DeviceSetOnly */ false)){
+Score = 0;
+m.insert({u, Score});
+  	continue;	}
+   	// Check if its clearly not the best.
+	Score = getVariantMatchScore(VMI, Ctx, ConstructMatches);
+	m.insert({u, Score});	
+	}
+			
+for (auto& it : m) 
+  A.push_back(it);
+	
+std::sort(A.begin(), A.end(), [] (std::pair,
+	std::pair){	
+	return a.second.ugt(b.second);
+});	
+}
+ 
+
+
 int llvm::omp::getBestVariantMatchForContext(
 const SmallVectorImpl , const OMPContext ) {
 
Index: llvm/include/llvm/Frontend/OpenMP/OMPContext.h
===
--- llvm/include/llvm/Frontend/OpenMP/OMPContext.h
+++ llvm/include/llvm/Frontend/OpenMP/OMPContext.h
@@ -189,6 +189,15 @@
 int getBestVariantMatchForContext(const SmallVectorImpl ,
   const OMPContext );
 
+/// Sort array \p A of clause index  with score
+/// This will be used to produce AST clauses
+/// in a sorted order with the clause with the highiest order
+/// on the top and default clause at the bottom
+void getArrayVariantMatchForContext(
+const SmallVectorImpl , const OMPContext ,
+SmallVector> );
+
+// new--
 } // namespace omp
 
 template <> struct DenseMapInfo {
Index: clang/test/OpenMP/metadirective_ast_print_new_3.cpp
===
--- /dev/null
+++ clang/test/OpenMP/metadirective_ast_print_new_3.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -verify  -fopenmp  -ast-print %s -o - | FileCheck %s
+// expected-no-diagnostics
+
+int main() {
+  int N = 15;
+#pragma omp metadirective when(user = {condition(N > 10)} : parallel for)\
+ default(target teams) 
+  for (int i = 0; i < N; i++)
+;
+
+
+#pragma omp metadirective when(device = {arch("nvptx64")}, user = {condition(N >= 100)} : parallel for)\
+  default(target parallel for)
+  for (int i = 0; i < N; i++)
+;
+  return 0;
+}
+
+
+
+// CHECK: #pragma omp metadirective when(user={condition(N > 10)}: parallel for) default(target teams)
+// CHECK: #pragma omp metadirective when(device={arch(nvptx64)}, user={condition(N >= 100)}: parallel for) default(target parallel for)
Index: clang/test/OpenMP/metadirective_ast_print_new_2.cpp
===
--- /dev/null
+++ clang/test/OpenMP/metadirective_ast_print_new_2.cpp
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -verify  -fopenmp  -ast-print %s -o - | FileCheck %s
+// expected-no-diagnostics
+
+void bar(){
+	int i=0;	
+}
+
+void myfoo(void){
+
+	int N = 13;
+	int b,n;
+	int a[100];
+
+	
+	#pragma omp  metadirective when (user = {condition(N>10)}: target  teams distribute parallel for ) \
+	when (user = {condition(N==10)}: parallel for )\
+	when (user = {condition(N==13)}: parallel for simd) \
+	when ( device={arch("arm")}:   target teams num_teams(512) thread_limit(32))\
+	when ( device={arch("nvptx")}: target teams num_teams(512) thread_limit(32))\
+	default ( parallel for)\
+

[PATCH] D123898: Fix crash in ObjC codegen introduced with 5ab6ee75994d645725264e757d67bbb1c96fb2b6

2022-04-17 Thread David Chisnall via Phabricator via cfe-commits
theraven added a comment.

I'd like to.  The test case from the original bug report was very large but I'm 
not sure how to trigger this with anything comprehensibly small.  You need 
something where the callee is responsible for destroying the argument and I'm 
not sure what combination of properties / ABIs results in that.  The original 
test was `-(void)foo:(std::string)aString` on the MSVC ABI, but I don't know 
how much of the Visual Studio `std::string` implementation is necessary to 
trigger this behaviour.  Is it just a non-trivial destructor?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123898/new/

https://reviews.llvm.org/D123898

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D15166: Fix C++ support on recent DragonFly BSD releases

2022-04-17 Thread Antonio Huete Jimenez via Phabricator via cfe-commits
tuxillo added a comment.
Herald added a project: All.

What can we do to move this forward?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D15166/new/

https://reviews.llvm.org/D15166

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D119136: [clang] Implement Change scope of lambda trailing-return-type

2022-04-17 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment.

@grandinj Thanks for notifying me of this issue, and sorry for the 
inconvenience.

There is a fix here https://reviews.llvm.org/D123909
Should the review of that linger too long, I'll revert this patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119136/new/

https://reviews.llvm.org/D119136

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123909: [Clang] Use of decltype(capture) in parameter-declaration-clause

2022-04-17 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin created this revision.
Herald added a project: All.
cor3ntin requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Partially implement the proposed resolution to CWG2569.

D119136  broke some libstdc++ code, as 
P2036R3, implemented as a DR to
C++11 made ill-formed some previously valid and innocuous code.

We resolve this issue to allow decltype(x) - but not decltype((x)
to appear in the parameter list of a lambda that capture x by copy.

Unlike CWG2569, we do not extend that special treatment to
sizeof/noexcept yet, as the resolution has not been approved yet
and keeping the review small allows a quicker fix of impacted code.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123909

Files:
  clang/include/clang/Parse/Parser.h
  clang/include/clang/Sema/Sema.h
  clang/lib/Parse/ParseDeclCXX.cpp
  clang/lib/Parse/ParseExprCXX.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/test/SemaCXX/lambda-capture-type-deduction.cpp

Index: clang/test/SemaCXX/lambda-capture-type-deduction.cpp
===
--- clang/test/SemaCXX/lambda-capture-type-deduction.cpp
+++ clang/test/SemaCXX/lambda-capture-type-deduction.cpp
@@ -87,23 +87,23 @@
   int y, z;// expected-note 2{{declared here}}
   auto implicit_tpl = [=]( // expected-note {{variable 'y' is captured here}}
   decltype(
-  [&] { return 0; }) y) { //expected-error{{captured variable 'y' cannot appear here}}
+  [&] { return 0; }) y) { // expected-error{{captured variable 'y' cannot appear here}}
 return y;
   };
 
-  auto init_tpl = [x = 1](  // expected-note{{explicitly captured here}}
-  decltype([&] { return 0; }) y) { // expected-error {{captured variable 'x' cannot appear here}}
+  auto init_tpl = [x = 1](// expected-note{{explicitly captured here}}
+  decltype([&] { return 0; }) y) { // expected-error {{captured variable 'x' cannot appear here}}
 return x;
   };
 
   auto implicit = [=]( // expected-note {{variable 'z' is captured here}}
   decltype(
-  [&](decltype(z)) { return 0; }) z) { //expected-error{{captured variable 'z' cannot appear here}}
+  [&](decltype((z))) { return 0; }) z) { // expected-error{{captured variable 'z' cannot appear here}}
 return z;
   };
 
-  auto init = [x = 1](  // expected-note{{explicitly captured here}}
-  decltype([&](decltype(x)) { return 0; }) y) { // expected-error {{captured variable 'x' cannot appear here}}
+  auto init = [x = 1](// expected-note{{explicitly captured here}}
+  decltype([&](decltype((x))) { return 0; }) y) { // expected-error {{captured variable 'x' cannot appear here}}
 return x;
   };
 
@@ -141,20 +141,20 @@
   decltype([&](
decltype([=]( // expected-note {{variable 'x' is captured here}}
 decltype([&](
- decltype([&](decltype(x)) {}) // expected-error{{captured variable 'x' cannot appear here}}
+ decltype([&](decltype((x))) {}) // expected-error{{captured variable 'x' cannot appear here}}
  ) {})) {})) {})){};
 
   (void)[&](
   decltype([&](
decltype([&](
 decltype([&](
- decltype([&](decltype(y)) {})) {})) {})) {})){};
+ decltype([&](decltype((y))) {})) {})) {})) {})){};
 
   (void)[=](
   decltype([=](
decltype([=](
-decltype([=](  // expected-note {{variable 'z' is captured here}}
- decltype([&] {}) // expected-error{{captured variable 'z' cannot appear here}}
+decltype([=](// expected-note {{variable 'z' is captured here}}
+ decltype([&] {}) // expected-error{{captured variable 'z' cannot appear here}}
  ) {})) {})) {})){};
 }
 
@@ -171,3 +171,13 @@
   dependent(r);
   dependent(cr);
 }
+
+void test_CWG2569_tpl(auto a) {
+  (void)[=](decltype(a) b = decltype(a)()){};
+}
+
+void test_CWG2569() {
+  int a = 0;
+  (void)[=](decltype(a) b = decltype(a)()){};
+  test_CWG2569_tpl(0);
+}
Index: clang/lib/Sema/SemaExpr.cpp
===
--- clang/lib/Sema/SemaExpr.cpp
+++ 

[PATCH] D123456: [C89/C2x] Diagnose calls to a function without a prototype but passes arguments

2022-04-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision.
aaron.ballman added a comment.

I've landed in 33d3fc4466479285121cbb1a62db249454da0bda 



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123456/new/

https://reviews.llvm.org/D123456

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123682: [clang-tblgen] Automatically document options values

2022-04-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment.

In D123682#3454627 , 
@serge-sans-paille wrote:

> @aaron.ballman Any thoughs on the above suggestion? I'd be happy to adopt any 
> of those :-)

I'd go with:

More than two choices: ` should be 'return', 'branch', 'full', or 'none'`
Only two choices: ` should be 'split' or 'single'.`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123682/new/

https://reviews.llvm.org/D123682

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 7f31b4a - [randstruct] Enforce using a designated init for a randomized struct

2022-04-17 Thread Bill Wendling via cfe-commits

Author: Bill Wendling
Date: 2022-04-16T23:24:48-07:00
New Revision: 7f31b4a917d8cc13df5eac4b7f0520639c3a8fff

URL: 
https://github.com/llvm/llvm-project/commit/7f31b4a917d8cc13df5eac4b7f0520639c3a8fff
DIFF: 
https://github.com/llvm/llvm-project/commit/7f31b4a917d8cc13df5eac4b7f0520639c3a8fff.diff

LOG: [randstruct] Enforce using a designated init for a randomized struct

A randomized structure needs to use a designated or default initializer.
Using a non-designated initializer will result in values being assigned
to the wrong fields.

Differential Revision: https://reviews.llvm.org/D123763

Added: 
clang/test/Sema/init-randomized-struct.c

Modified: 
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaInit.cpp

Removed: 




diff  --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td 
b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index a14194d271a71..e79a40d62381f 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -11602,7 +11602,9 @@ def err_hlsl_pointers_unsupported : Error<
 def err_hlsl_operator_unsupported : Error<
   "the '%select{&|*|->}0' operator is unsupported in HLSL">;
 
-// Layout randomization warning.
+// Layout randomization diagnostics.
+def err_non_designated_init_used : Error<
+  "a randomized struct can only be initialized with a designated initializer">;
 def err_cast_from_randomized_struct : Error<
   "casting from randomized structure pointer type %0 to %1">;
 } // end of sema component.

diff  --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index c3bbefbaaed1b..233be547bf118 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -2123,6 +2123,7 @@ void InitListChecker::CheckStructUnionTypes(
   // worthwhile to skip over the rest of the initializer, though.
   RecordDecl *RD = DeclType->castAs()->getDecl();
   RecordDecl::field_iterator FieldEnd = RD->field_end();
+  size_t NumRecordFields = std::distance(RD->field_begin(), RD->field_end());
   bool CheckForMissingFields =
 !IList->isIdiomaticZeroInitializer(SemaRef.getLangOpts());
   bool HasDesignatedInit = false;
@@ -2172,6 +2173,35 @@ void InitListChecker::CheckStructUnionTypes(
   break;
 }
 
+// Check if this is an initializer of forms:
+//
+//   struct foo f = {};
+//   struct foo g = {0};
+//
+// These are okay for randomized structures. [C99 6.7.8p19]
+//
+// Also, if there is only one element in the structure, we allow something
+// like this, because it's really not randomized in the tranditional sense.
+//
+//   struct foo h = {bar};
+auto IsZeroInitializer = [&](const Expr *I) {
+  if (IList->getNumInits() == 1) {
+if (NumRecordFields == 1)
+  return true;
+if (const auto *IL = dyn_cast(I))
+  return IL->getValue().isZero();
+  }
+  return false;
+};
+
+// Don't allow non-designated initializers on randomized structures.
+if (RD->isRandomized() && !IsZeroInitializer(Init)) {
+  if (!VerifyOnly)
+SemaRef.Diag(InitLoc, diag::err_non_designated_init_used);
+  hadError = true;
+  break;
+}
+
 // We've already initialized a member of a union. We're done.
 if (InitializedSomething && DeclType->isUnionType())
   break;

diff  --git a/clang/test/Sema/init-randomized-struct.c 
b/clang/test/Sema/init-randomized-struct.c
new file mode 100644
index 0..60403a91a547b
--- /dev/null
+++ b/clang/test/Sema/init-randomized-struct.c
@@ -0,0 +1,57 @@
+// RUN: %clang_cc1 -triple=x86_64-unknown-linux 
-frandomize-layout-seed=1234567890abcdef \
+// RUN:  -verify -fsyntax-only -Werror %s
+
+// Initializing a randomized structure requires a designated initializer,
+// otherwise the element ordering will be off. The only exceptions to this rule
+// are:
+//
+//- A structure with only one element, and
+//- A structure initialized with "{0}".
+//
+// These are well-defined situations where the field ordering doesn't affect
+// the result.
+
+typedef void (*func_ptr)();
+
+void foo(void);
+void bar(void);
+void baz(void);
+void gaz(void);
+
+struct test {
+  func_ptr a;
+  func_ptr b;
+  func_ptr c;
+  func_ptr d;
+  func_ptr e;
+  func_ptr f;
+  func_ptr g;
+} __attribute__((randomize_layout));
+
+struct test t1 = {}; // This should be fine per WG14 N2900 (in C23) + our 
extension handling of it in earlier modes
+struct test t2 = { 0 }; // This should also be fine per C99 6.7.8p19
+struct test t3 = { .f = baz, .b = bar, .g = gaz, .a = foo }; // Okay
+struct test t4 = { .a = foo, bar, baz }; // expected-error {{a randomized 
struct can only be initialized with a designated initializer}}
+
+struct other_test {
+  func_ptr a;
+  func_ptr b[3];
+  func_ptr c;
+} __attribute__((randomize_layout));
+
+struct other_test t5 = { .a = foo, .b[0] = foo }; // Okay

[PATCH] D116280: [clang] adds unary type trait checks as compiler built-ins

2022-04-17 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments.



Comment at: clang/lib/Sema/SemaExprCXX.cpp:4889-4890
 return T->isArrayType();
+  case UTT_IsBoundedArray:
+return T->isArrayType() && !T->isIncompleteArrayType();
+  case UTT_IsUnboundedArray:

aaron.ballman wrote:
> Is a VLA a bounded array? (We support those as an extension in C++, 
> unfortunately.)
`__is_bounded_array(T)` is true when "`T` is an array type of known bound". Do 
VLAs meet this criteria?



Comment at: clang/lib/Sema/SemaExprCXX.cpp:5289
+if (UTT == UTT_IsCopyAssignable) {
+  return EvaluateBinaryTypeTrait(Self, BTT_IsAssignable, 
Self.BuildReferenceType(T, true, KeyLoc, T.getBaseTypeIdentifier()), 
AssigneeType, KeyLoc);
+}

aaron.ballman wrote:
> It looks like this file could stand to be clang formatted.
Yeah, there was a time where `arc diff` did the formatting automatically, but 
it seems that day has passed :(



Comment at: clang/test/SemaCXX/type-traits.cpp:764
+  int t30[F(__is_bounded_array(void*))];
+  int t31[F(__is_bounded_array(cvoid*))];
+}

aaron.ballman wrote:
> Any reason there's not a test with something like `int[10]` and `int[]`? 
> (Same below.)
Those are `IntAr` and `IntArNB` at the very top. I can rename those if you'd 
like.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116280/new/

https://reviews.llvm.org/D116280

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116280: [clang] adds unary type trait checks as compiler built-ins

2022-04-17 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 423280.
cjdb marked 3 inline comments as done.
cjdb added a comment.

- finishes `__is_move_constructible` and `__is_move_assignable`
- fixes detecting C++ mode
- clang-formats


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116280/new/

https://reviews.llvm.org/D116280

Files:
  clang/include/clang/Basic/TokenKinds.def
  clang/include/clang/Sema/Sema.h
  clang/lib/Parse/ParseDeclCXX.cpp
  clang/lib/Parse/ParseExpr.cpp
  clang/lib/Sema/SemaExprCXX.cpp
  clang/lib/Sema/SemaType.cpp
  clang/test/SemaCXX/type-traits.cpp

Index: clang/test/SemaCXX/type-traits.cpp
===
--- clang/test/SemaCXX/type-traits.cpp
+++ clang/test/SemaCXX/type-traits.cpp
@@ -345,11 +345,19 @@
 }
 
 typedef Enum EnumType;
+typedef EnumClass EnumClassType;
 
 void is_enum()
 {
   { int arr[T(__is_enum(Enum))]; }
   { int arr[T(__is_enum(EnumType))]; }
+  { int arr[T(__is_enum(SignedEnum))]; }
+  { int arr[T(__is_enum(UnsignedEnum))]; }
+
+  { int arr[T(__is_enum(EnumClass))]; }
+  { int arr[T(__is_enum(EnumClassType))]; }
+  { int arr[T(__is_enum(SignedEnumClass))]; }
+  { int arr[T(__is_enum(UnsignedEnumClass))]; }
 
   { int arr[F(__is_enum(int))]; }
   { int arr[F(__is_enum(Union))]; }
@@ -363,6 +371,29 @@
   { int arr[F(__is_enum(HasAnonymousUnion))]; }
 }
 
+void is_scoped_enum() {
+  { int arr[F(__is_scoped_enum(Enum))]; }
+  { int arr[F(__is_scoped_enum(EnumType))]; }
+  { int arr[F(__is_scoped_enum(SignedEnum))]; }
+  { int arr[F(__is_scoped_enum(UnsignedEnum))]; }
+
+  { int arr[T(__is_scoped_enum(EnumClass))]; }
+  { int arr[T(__is_scoped_enum(EnumClassType))]; }
+  { int arr[T(__is_scoped_enum(SignedEnumClass))]; }
+  { int arr[T(__is_scoped_enum(UnsignedEnumClass))]; }
+
+  { int arr[F(__is_scoped_enum(int))]; }
+  { int arr[F(__is_scoped_enum(Union))]; }
+  { int arr[F(__is_scoped_enum(Int))]; }
+  { int arr[F(__is_scoped_enum(IntAr))]; }
+  { int arr[F(__is_scoped_enum(UnionAr))]; }
+  { int arr[F(__is_scoped_enum(Derives))]; }
+  { int arr[F(__is_scoped_enum(ClassType))]; }
+  { int arr[F(__is_scoped_enum(cvoid))]; }
+  { int arr[F(__is_scoped_enum(IntArNB))]; }
+  { int arr[F(__is_scoped_enum(HasAnonymousUnion))]; }
+}
+
 struct FinalClass final {
 };
 
@@ -702,6 +733,64 @@
   int t31[F(__is_array(cvoid*))];
 }
 
+void is_bounded_array() {
+  int t01[T(__is_bounded_array(IntAr))];
+  int t02[F(__is_bounded_array(IntArNB))];
+  int t03[T(__is_bounded_array(UnionAr))];
+
+  int t10[F(__is_bounded_array(void))];
+  int t11[F(__is_bounded_array(cvoid))];
+  int t12[F(__is_bounded_array(float))];
+  int t13[F(__is_bounded_array(double))];
+  int t14[F(__is_bounded_array(long double))];
+  int t15[F(__is_bounded_array(bool))];
+  int t16[F(__is_bounded_array(char))];
+  int t17[F(__is_bounded_array(signed char))];
+  int t18[F(__is_bounded_array(unsigned char))];
+  int t19[F(__is_bounded_array(wchar_t))];
+  int t20[F(__is_bounded_array(short))];
+  int t21[F(__is_bounded_array(unsigned short))];
+  int t22[F(__is_bounded_array(int))];
+  int t23[F(__is_bounded_array(unsigned int))];
+  int t24[F(__is_bounded_array(long))];
+  int t25[F(__is_bounded_array(unsigned long))];
+  int t26[F(__is_bounded_array(Union))];
+  int t27[F(__is_bounded_array(Derives))];
+  int t28[F(__is_bounded_array(ClassType))];
+  int t29[F(__is_bounded_array(Enum))];
+  int t30[F(__is_bounded_array(void *))];
+  int t31[F(__is_bounded_array(cvoid *))];
+}
+
+void is_unbounded_array() {
+  int t01[F(__is_unbounded_array(IntAr))];
+  int t02[T(__is_unbounded_array(IntArNB))];
+  int t03[F(__is_unbounded_array(UnionAr))];
+
+  int t10[F(__is_unbounded_array(void))];
+  int t11[F(__is_unbounded_array(cvoid))];
+  int t12[F(__is_unbounded_array(float))];
+  int t13[F(__is_unbounded_array(double))];
+  int t14[F(__is_unbounded_array(long double))];
+  int t15[F(__is_unbounded_array(bool))];
+  int t16[F(__is_unbounded_array(char))];
+  int t17[F(__is_unbounded_array(signed char))];
+  int t18[F(__is_unbounded_array(unsigned char))];
+  int t19[F(__is_unbounded_array(wchar_t))];
+  int t20[F(__is_unbounded_array(short))];
+  int t21[F(__is_unbounded_array(unsigned short))];
+  int t22[F(__is_unbounded_array(int))];
+  int t23[F(__is_unbounded_array(unsigned int))];
+  int t24[F(__is_unbounded_array(long))];
+  int t25[F(__is_unbounded_array(unsigned long))];
+  int t26[F(__is_unbounded_array(Union))];
+  int t27[F(__is_unbounded_array(Derives))];
+  int t28[F(__is_unbounded_array(ClassType))];
+  int t29[F(__is_unbounded_array(Enum))];
+  int t30[F(__is_unbounded_array(void *))];
+  int t31[F(__is_unbounded_array(cvoid *))];
+}
+
 template  void tmpl_func(T&) {}
 
 template  struct type_wrapper {
@@ -934,6 +1023,42 @@
   int t34[F(__is_pointer(void (StructWithMembers::*) ()))];
 }
 
+void is_null_pointer() {
+  StructWithMembers x;
+
+  int t00[T(__is_nullptr(decltype(nullptr)))];
+  int t01[F(__is_nullptr(void