[clang] [Sema][Test] Add c++17 standard specifier to diagnostic test. (PR #222907)
Tom Weaver via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 11 03:09:09 PDT 2026
https://github.com/TomWeaver18 created https://github.com/llvm/llvm-project/pull/222907
Test additions introduced in 1ec7a13fb238 caused later than c++17 defaulting configurations to fail for this specific test due to CTAD rules enabling initialization and instantiation of the added templates in the test.
This causes some of the expected diagnostics to go missing and has others appear.
The change adds a c++17 specifier to the run line to avoid the test failing for later c++ standard defaults.
Changes to be committed:
modified: clang/test/SemaTemplate/instantiate-member-initializers.cpp
>From 6581471553c490c0a3a4b8d5b775dd735e5fd5b1 Mon Sep 17 00:00:00 2001
From: Tom Weaver <tom.weaver at sony.com>
Date: Thu, 10 Sep 2026 11:26:32 +0100
Subject: [PATCH] [Sema][Test] Add c++17 standard specifier to diagnostic test.
Test additions introduced in 1ec7a13fb238 caused later than c++17 defaulting
configurations to fail for this specific test due to CTAD rules enabling
initialization and instantiation of the added templates in the test.
This causes some of the expected diagnostics to go missing and has others
appear.
The change adds a c++17 specifier to the run line to avoid the test
failing for later c++ standard defaults.
Changes to be committed:
modified: clang/test/SemaTemplate/instantiate-member-initializers.cpp
---
clang/test/SemaTemplate/instantiate-member-initializers.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/test/SemaTemplate/instantiate-member-initializers.cpp b/clang/test/SemaTemplate/instantiate-member-initializers.cpp
index bd84dcdecbe62..4242543fcb94c 100644
--- a/clang/test/SemaTemplate/instantiate-member-initializers.cpp
+++ b/clang/test/SemaTemplate/instantiate-member-initializers.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -Wall -verify %s
+// RUN: %clang_cc1 -std=c++17 -fsyntax-only -Wall -verify %s
template<typename T> struct A {
A() : a(1) { } // expected-error{{cannot initialize a member subobject of type 'void *' with an rvalue of type 'int'}}
More information about the cfe-commits
mailing list