<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 - std::variant<std::string> not working with -std=c++20 in TRUNK Clang of GodBolt"
href="https://bugs.llvm.org/show_bug.cgi?id=52576">52576</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>std::variant<std::string> not working with -std=c++20 in TRUNK Clang of GodBolt
</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>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>release blocker
</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>artyom.polkovnikov@gmail.com
</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>Created <span class=""><a href="attachment.cgi?id=25465" name="attach_25465" title="Errors log">attachment 25465</a> <a href="attachment.cgi?id=25465&action=edit" title="Errors log">[details]</a></span>
Errors log
If I compile on godbolt's trunk Clang with option -std=c++20 following code:
#include <variant>
#include <string>
int main() { std::variant<std::string> s = std::string("abc"); }
I get lots of errors:
==================================================
In file included from <source>:1:
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/variant:460:2:
error: attempt to use a deleted function
_Variant_storage(in_place_index_t<_Np>, _Args&&... __args)
^
............... MANY MORE ERRORS HERE .......................
==================================================
but if I compile same code with -std=c++17 or with release 13.0.0 CLang, then
everything compiles and works.
I got this error with -std=c++20 on current TRUNK in GodBolt
<a href="https://godbolt.org/z/x4o8GKbTv">https://godbolt.org/z/x4o8GKbTv</a>
while -std=c++17 on TRUNK works <a href="https://godbolt.org/z/on9EbeY7z">https://godbolt.org/z/on9EbeY7z</a> and also
release 13.0.0 works with -std=c++20 <a href="https://godbolt.org/z/vGhj7q63z">https://godbolt.org/z/vGhj7q63z</a>
Attaching full log "errors.txt" of errors in case if godbolt updates TRUNK to
some other working version.</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>