Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
gcc struct/classes
[davide@localhost bin]$ g++ blah.cpp -o blah
blah.cpp: In function ‘int main()’:
blah.cpp:10:9: error: ‘union’ tag used in naming ‘struct G<int>’ [-fpermissive]
union G<int> foo;
^
blah.cpp:4:7: note: ‘struct G<int>’ was previously declared here
class G {
^
[davide@localhost bin]$ cat blah.cpp
#include <stdio.h>
template <typename T>
class G {
public:
G<T>() { puts("blah"); }
};
int main() {
union G<int> foo;
return (0);
}
[davide@localhost bin]$ g++ --version
g++ (GCC) 5.3.1 20151207 (Red Hat 5.3.1-2)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.