weixin_39822993 2020-11-30 11:25
浏览 0

Test template_args fails on MSVC

Originally reported on Google Code with ID 89


What steps will reproduce the problem?
1. $ python run_iwyu_tests template_args

What is the expected output? What do you see instead?

 Expected: success.

 Actual: AssertionError: tests/template_args.cc:18: Unexpected diagnostic:
  IndirectClass is defined in "tests/indirect.h", which isn't directly
  #included (for autocast).

This is because all classes are erroneously classified as having a conversion constructor.

For some reason an implicit move ctor is generated, which tripped up our conversion
ctor detection. I thought IWYU ran in C++03 mode?

Attached patch do not treat implicit move ctors as conversion ctors. Two more tests
pass for MSVC, I haven't been able to try other platforms.

Reported by kim.grasman on 2013-01-01 22:29:15

该提问来源于开源项目:include-what-you-use/include-what-you-use

  • 写回答

11条回答 默认 最新

  • weixin_39822993 2020-11-30 11:25
    关注
    
    Clang/LLVM r171027. There are consistent test failures since forever with MSVC on Windows,
    so I don't think it's a new thing (though I'm not 100% sure that this specific test
    has failed before.)
    
    It could be a Clang/Windows quirk that move constructors are generated in C++03 mode.
    Either way, the patch makes HasImplicitConversionCtor C++11-aware.
    

    Reported by kim.grasman on 2013-01-02 09:50:00

    评论

报告相同问题?