[PATCH] D57906: [CTU] Do not allow different CPP dialects in CTU

2019-02-28 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. martong marked an inline comment as done. Closed by commit rC355096: [CTU] Do not allow different CPP dialects in CTU (authored by martong, committed by ). Changed prior to commit:

[PATCH] D57906: [CTU] Do not allow different CPP dialects in CTU

2019-02-28 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. LGTM! I think we should commit this as is for now but maybe adding a TODO comment to summarize the problem would be nice. Maybe we could have an isSameDialect or similar method within

[PATCH] D57906: [CTU] Do not allow different CPP dialects in CTU

2019-02-26 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added inline comments. Comment at: lib/CrossTU/CrossTranslationUnit.cpp:255 + // in the other unit it has none. + if (LangTo.CPlusPlus11 != LangFrom.CPlusPlus11 || + LangTo.CPlusPlus14 != LangFrom.CPlusPlus14 ||

[PATCH] D57906: [CTU] Do not allow different CPP dialects in CTU

2019-02-11 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > How is #if __cplusplus >= 201103L qualitatively different from #ifndef NDEBUG > or #if MYLIB_ABI_VERSION==2 or #if __DATE__ == "2018-04-01"? Ideally, all macros should be the same in the two TUs... If we were very strict then we could check for that, but that might

[PATCH] D57906: [CTU] Do not allow different CPP dialects in CTU

2019-02-08 Thread Rafael Stahl via Phabricator via cfe-commits
r.stahl added inline comments. Comment at: lib/CrossTU/CrossTranslationUnit.cpp:255 + // in the other unit it has none. + if (LangTo.CPlusPlus11 != LangFrom.CPlusPlus11 || + LangTo.CPlusPlus14 != LangFrom.CPlusPlus14 || This is likely to become a bug in

[PATCH] D57906: [CTU] Do not allow different CPP dialects in CTU

2019-02-08 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added a comment. > Consider this STL code: > > template > struct __alloc_traits > #if __cplusplus >= 201103L > : std::allocator_traits<_Alloc> > #endif > { // ... > }; > > > This class template would create ODR errors during merging the two units, > since in

[PATCH] D57906: [CTU] Do not allow different CPP dialects in CTU

2019-02-08 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: lib/CrossTU/CrossTranslationUnit.cpp:232 + + // We do not support CTU across languages (C vs C++). if (LangTo.CPlusPlus != LangFrom.CPlusPlus) { a_sidorin wrote: > The comment change looks strange. Ok, I reverted

[PATCH] D57906: [CTU] Do not allow different CPP dialects in CTU

2019-02-08 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 185926. martong marked 4 inline comments as done. martong added a comment. - Revert comment change - Add lang_dialect_mismatch and stats for that Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57906/new/

[PATCH] D57906: [CTU] Do not allow different CPP dialects in CTU

2019-02-07 Thread Aleksei Sidorin via Phabricator via cfe-commits
a_sidorin added a comment. Hi Gabor, Please find my comments inline. Comment at: lib/CrossTU/CrossTranslationUnit.cpp:232 + + // We do not support CTU across languages (C vs C++). if (LangTo.CPlusPlus != LangFrom.CPlusPlus) { The comment change looks

[PATCH] D57906: [CTU] Do not allow different CPP dialects in CTU

2019-02-07 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: xazax.hun, a_sidorin, r.stahl. Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp, rnkovacs. Herald added a project: clang. If CPP dialects are different then return with error. Consider this STL code: template