<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - -fconcepts-ts causes incorrect name lookup for non-type template parameter"
href="https://bugs.llvm.org/show_bug.cgi?id=44615">44615</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-fconcepts-ts causes incorrect name lookup for non-type template parameter
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++2a
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>david@doublewise.net
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>The following code
```
namespace s {
using t = int;
};
template<s::t>
void f();
```
when compiled with
`clang++ -Xclang -fconcepts-ts -std=c++2a -c main.cpp`
at revision bb9b964
does not actually look up `t` in `s`. Instead, it looks it up in the global
scope, and thus it gives an error of
```
main.cpp:6:13: error: unknown type name 't'; did you mean 's::t'?
template<s::t>
^
s::t
main.cpp:2:8: note: 's::t' declared here
using t = int;
^
1 error generated.
```
If I define a `t` in the global scope as well, it picks up that name and
compiles, using that variable instead. This is demonstrated by the following
program:
```
#include <type_traits>
namespace s {
using t = int;
};
using t = short;
template<s::t x>
void f() {
static_assert(std::is_same_v<decltype(x), int>);
}
void g() {
f<0>();
}
```
This behavior occurs only if `-Xclang -fconcepts-ts` is passed, but it seems
that this flag is necessary to actually get all of the concepts implementation.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>