| 1 |
// PR c++/100881 |
| 2 |
// { dg-additional-options "-std=c++20 -fmodules-ts" } |
| 3 |
// { dg-module-cmi pr100881 } |
| 4 |
module; |
| 5 |
#include <source_location> |
| 6 |
export module pr100881; |
| 7 |
|
| 8 |
export |
| 9 |
consteval int |
| 10 |
current_line_fn(const std::source_location& loc = std::source_location::current()) |
| 11 |
{ |
| 12 |
return loc.line(); |
| 13 |
} |
| 14 |
|
| 15 |
export |
| 16 |
struct current_line_cls |
| 17 |
{ |
| 18 |
int line = std::source_location::current().line(); |
| 19 |
}; |
| 20 |
|
| 21 |
export |
| 22 |
template<class T> |
| 23 |
consteval int |
| 24 |
current_line_fn_tmpl(const std::source_location& loc = std::source_location::current()) |
| 25 |
{ |
| 26 |
return loc.line(); |
| 27 |
} |
| 28 |
|
| 29 |
export |
| 30 |
template<class T> |
| 31 |
struct current_line_cls_tmpl |
| 32 |
{ |
| 33 |
int line = std::source_location::current().line(); |
| 34 |
}; |