]> granicus.if.org Git - clang/commit
[CTU] Do not allow different CPP dialects in CTU
authorGabor Marton <martongabesz@gmail.com>
Thu, 28 Feb 2019 15:24:59 +0000 (15:24 +0000)
committerGabor Marton <martongabesz@gmail.com>
Thu, 28 Feb 2019 15:24:59 +0000 (15:24 +0000)
commit658222e2d9871980db75fa038ba72c930c7c58d7
treee92e5ccecfd5ec342b14e890e0b592aa5eba4cc8
parent868d5cc1e7ae0c2b8295e1781ca58eba2bc251f8
[CTU] Do not allow different CPP dialects in CTU

Summary:
If CPP dialects are different then return with error.

Consider this STL code:
  template<typename _Alloc>
    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 one translation unit the class template has a base class, however
in the other unit it has none.

Reviewers: xazax.hun, a_sidorin, r.stahl

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D57906

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355096 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/CrossTU/CrossTranslationUnit.h
lib/CrossTU/CrossTranslationUnit.cpp