[clang] [Sema][Test] Add c++17 standard specifier to diagnostic test. (PR #222907)

via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 11 03:09:48 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Tom Weaver (TomWeaver18)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/222907.diff


1 Files Affected:

- (modified) clang/test/SemaTemplate/instantiate-member-initializers.cpp (+1-1) 


``````````diff
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'}}

``````````

</details>


https://github.com/llvm/llvm-project/pull/222907


More information about the cfe-commits mailing list