On Thu, Apr 28, 2016 at 1:14 PM, Akira Hatanaka via cfe-commits < cfe-commits@lists.llvm.org> wrote:
> ahatanak added a comment. > > If I try calling Init(AnyParent, F) in Scope::setFlags, clang fails to > compile the following code because it cannot find the definition of struct > "foo": > > void foo3(void) > struct foo { > int a, f; > }; > char *np = nullptr; > int *ip = &(((struct foo *)np)->f); > *ip = 0; > } > > I can fix this test if I add a boolean flag to Scope::Init, which tells > the function to return early before DeclsInScope and other fields are > cleared. > Instead of adding the bool parameter to `Init`, how about this: move `setFlags` out of line, move the parts of `Init` that compute things based on the flags into `setFlags`, and call `setFlags` from `Init`. > All the other tests pass too except for test/CXX/drs/dr1xx.cpp: > > namespace dr183 { // dr183: sup 382 > template<typename T> struct A {}; > template<typename T> struct B { > typedef int X; > }; > template<> struct A<int> { > typename B<int>::X x; > }; > } > > clang used to compile this code without any warnings or errors, but it now > issues the following warning if -std=c++98 is on the command line: > > dr1xx.cpp:7:5: warning: 'typename' occurs outside of a template > [-Wc++11-extensions] > > typename B<int>::X x; > ^~~~~~~~~ > > 1 warning generated. > > Is clang correct to issue the warning in this case? Yes. > http://reviews.llvm.org/D19175 > > > > _______________________________________________ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits