File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 66// LICENSE.TXT for details.
77
88//------------------------------------------------------------------------------
9- // RUN: cat %s | %cling | FileCheck %s
9+ // std::source_location is a C++20 feature.
10+ // RUN: cat %s | %cling -std=c++20 | FileCheck %s
1011
12+ .rawInput 1
1113#include <iostream>
1214#if __cplusplus >= 202002L
1315#include <version>
1416#endif
1517
16- #ifndef __cpp_lib_source_location
17- // Hack to prevent failure if __cpp_lib_source_location feature does not exist!
18- std ::cout << "(std::source_location) " ;
19- std ::cout << "CHECK_SRCLOC:42:std::source_location getsrcloc()\n" ;
20- #else
18+ #ifdef __cpp_lib_source_location
2119#include <source_location>
2220std ::source_location getsrcloc () {
2321#line 42 "CHECK_SRCLOC"
2422 return std ::source_location ::current ();
2523}
26- getsrcloc ()
24+ #else
25+ // Hack to prevent failure if __cpp_lib_source_location feature does not exist!
26+ void getsrcloc () {
27+ std ::cout << "(std::source_location) " ;
28+ std ::cout << "CHECK_SRCLOC:42:std::source_location getsrcloc()\n" ;
29+ }
2730#endif
31+ .rawInput 0
32+
33+ getsrcloc ()
2834// CHECK: (std::source_location)
2935// CHECK: CHECK_SRCLOC:42:std::source_location getsrcloc()
You can’t perform that action at this time.
0 commit comments