Created
January 19, 2022 13:44
-
-
Save afabri/0416bebec1c32fb4efd6632446698972 to your computer and use it in GitHub Desktop.
VC2017 /permissive- fails on this
This file contains hidden or 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
#include <atomic> | |
#include <iostream> | |
struct Parallel_tag {}; | |
template <typename K, typename C> | |
struct Base { | |
typedef int A; | |
}; | |
template <typename K> | |
struct Base<K, Parallel_tag> { | |
typedef std::atomic<int> A; | |
}; | |
template <typename K, typename C> | |
struct Derived : Base<K, C> { | |
typedef Base<K,C>::A A; | |
void fct(); | |
A a = 0; | |
}; | |
template <typename K,typename C> | |
void Derived<K,C>::fct() | |
{ | |
++a; | |
std::cout << a << std::endl; | |
} | |
int main() | |
{ | |
Derived<int,Parallel_tag> d; | |
d.fct(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In fact VC2019 and VC2022 have the same problem