Created
April 4, 2016 16:45
-
-
Save SaitoAtsushi/44cca702aed8152f45b7f20cd1787193 to your computer and use it in GitHub Desktop.
clang で通るけど gcc でエラーになる
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
template<class T> | |
class foo { | |
friend void T::qux(void); | |
private: | |
int baz; | |
public: | |
foo(void) : baz(1){} | |
}; | |
#include <iostream> | |
class bar { | |
public: | |
void qux(void) { | |
std::cout << data.baz << std::endl; | |
} | |
private: | |
foo<bar> data; | |
}; | |
int main(void) { | |
bar x; | |
x.qux(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment