Created
December 13, 2021 17:28
-
-
Save ldionne/7ec0a1f4bd4e110ef72aff5021c529a2 to your computer and use it in GitHub Desktop.
Minimal reproducer for https://stackoverflow.com/q/69520633/627587
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cat <<EOF | clang++ -xc++ - -c -o string.o | |
template <class T> | |
struct basic_string { | |
__attribute__((internal_linkage)) | |
void shrink_to_fit(); | |
}; | |
template <class T> | |
void basic_string<T>::shrink_to_fit() { } | |
template class basic_string<char>; | |
EOF | |
cat <<EOF | clang++ -xc++ - -c -o main.o | |
template <class T> | |
struct basic_string { | |
__attribute__((internal_linkage)) | |
void shrink_to_fit(); | |
}; | |
template <class T> | |
void basic_string<T>::shrink_to_fit() { } | |
extern template class basic_string<char>; | |
int main() { | |
basic_string<char> s; | |
s.shrink_to_fit(); | |
} | |
EOF | |
clang++ string.o main.o | |
rm string.o main.o |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment