https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66256
--- Comment #4 from Benjamin Buch <benni.buch at gmail dot com> --- Same with decltype instead of noexcept: struct test{ // it only works if e is declared before test() using type = decltype(e); static const bool e = false; }; $ g++ -std=c++11 gcc-bug.cpp gcc-bug.cpp:3:27: error: 'e' was not declared in this scope using type = decltype(e); ^ gcc-bug.cpp:3:27: error: 'e' was not declared in this scope $ g++ --version g++ (GCC) 7.0.1 20170221 (experimental) Copyright (C) 2017 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.