Skip to content

Conversation

@frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Nov 7, 2025

This fixes incompleteness and inconsistency for test files added in adc7932, by

  • renaming libcxx/test/std/time/time.traits.is.clock/trait.is.clock.compile.pass.cpp to libcxx/test/std/time/time.traits/is.clock.compile.pass.cpp,
  • renaming libcxx/test/libcxx/time/time.traits.is.clock/trait.is.clock.compile.verify.cpp to libcxx/test/libcxx/time/time.traits/is.clock.verify.cpp , and
  • adding comments clarifying what are being tested.

This fixes incompleteness and inconsistency for a test file added in
adc7932, by
- renaming `trait.is.clock.compile.verify.cpp` to
`trait.is.clock.verify.cpp`, and
- adding comments clarifying what are being tested.
@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner November 7, 2025 04:02
@frederick-vs-ja frederick-vs-ja added libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. test-suite labels Nov 7, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 7, 2025

@llvm/pr-subscribers-libcxx

Author: A. Jiang (frederick-vs-ja)

Changes

This fixes incompleteness and inconsistency for a test file added in adc7932, by

  • renaming trait.is.clock.compile.verify.cpp to trait.is.clock.verify.cpp, and
  • adding comments clarifying what are being tested.

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

1 Files Affected:

  • (renamed) libcxx/test/libcxx/time/time.traits.is.clock/trait.is.clock.verify.cpp (+12)
diff --git a/libcxx/test/libcxx/time/time.traits.is.clock/trait.is.clock.compile.verify.cpp b/libcxx/test/libcxx/time/time.traits.is.clock/trait.is.clock.verify.cpp
similarity index 61%
rename from libcxx/test/libcxx/time/time.traits.is.clock/trait.is.clock.compile.verify.cpp
rename to libcxx/test/libcxx/time/time.traits.is.clock/trait.is.clock.verify.cpp
index e9ad59aba13cb..f4f438d348a85 100644
--- a/libcxx/test/libcxx/time/time.traits.is.clock/trait.is.clock.compile.verify.cpp
+++ b/libcxx/test/libcxx/time/time.traits.is.clock/trait.is.clock.verify.cpp
@@ -8,6 +8,18 @@
 
 // REQUIRES: std-at-least-c++20
 
+// <chrono>
+//
+// template<class T> struct is_clock;
+// template<class T> constexpr bool is_clock_v = is_clock<T>::value;
+
+// [time.traits.is.clock]/3:
+//  The behavior of a program that adds specializations for is_clock is undefined.
+
+// [namespace.std]/3:
+//   The behavior of a C++ program is undefined if it declares an explicit or partial specialization of any standard
+//   library variable template, except where explicitly permitted by the specification of that variable template.
+
 #include <chrono>
 #include <ratio>
 

@H-G-Hristov
Copy link
Contributor

H-G-Hristov commented Nov 7, 2025

This fixes incompleteness and inconsistency for a test file added in adc7932, by

* renaming `trait.is.clock.compile.verify.cpp` to `trait.is.clock.verify.cpp`, and

* adding comments clarifying what are being tested.

Let's rename the file to: libcxx/test/libcxx/time/time.traits/is.clock.verify.cpp by removing is.clock/trait from libcxx/test/libcxx/time/time.traits.is.clock/trait.is.clock.verify.cpp. I think that's the correct filename.

I also think we need the exact set of changes to: libcxx/test/std/time/time.traits.is.clock/trait.is.clock.compile.pass.cpp

@frederick-vs-ja frederick-vs-ja changed the title [libc++][test] Fix-up verifying test for is_clock(_v) [libc++][test] Fix-up tests for is_clock(_v) Nov 7, 2025
@H-G-Hristov
Copy link
Contributor

H-G-Hristov commented Nov 7, 2025

@frederick-vs-ja Thanks! LGTM

@frederick-vs-ja frederick-vs-ja merged commit f090dd1 into llvm:main Nov 7, 2025
80 checks passed
@frederick-vs-ja frederick-vs-ja deleted the test-verifying-is_clock branch November 7, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. test-suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants