forked from llvm-mirror/clang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ODRHash] Add diagnostic messages for typedef and type alias.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305238 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
7021b25
commit 7b936e3
Showing
3 changed files
with
154 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -586,6 +586,57 @@ S3 s3; | |
// [email protected]:* {{'TypeDef::S3::a' from module 'FirstModule' is not present in definition of 'TypeDef::S3' in module 'SecondModule'}} | ||
// [email protected]:* {{declaration of 'a' does not match}} | ||
#endif | ||
|
||
#if defined(FIRST) | ||
struct S4 { | ||
typedef int a; | ||
typedef int b; | ||
}; | ||
#elif defined(SECOND) | ||
struct S4 { | ||
typedef int b; | ||
typedef int a; | ||
}; | ||
#else | ||
S4 s4; | ||
// [email protected]:* {{'TypeDef::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found typedef name 'b'}} | ||
// [email protected]:* {{but in 'FirstModule' found typedef name 'a'}} | ||
#endif | ||
|
||
#if defined(FIRST) | ||
struct S5 { | ||
typedef int a; | ||
typedef int b; | ||
int x; | ||
}; | ||
#elif defined(SECOND) | ||
struct S5 { | ||
int x; | ||
typedef int b; | ||
typedef int a; | ||
}; | ||
#else | ||
S5 s5; | ||
// [email protected]:* {{'TypeDef::S5' has different definitions in different modules; first difference is definition in module 'SecondModule' found field}} | ||
// [email protected]:* {{but in 'FirstModule' found typedef}} | ||
#endif | ||
|
||
#if defined(FIRST) | ||
typedef float F; | ||
struct S6 { | ||
typedef int a; | ||
typedef F b; | ||
}; | ||
#elif defined(SECOND) | ||
struct S6 { | ||
typedef int a; | ||
typedef float b; | ||
}; | ||
#else | ||
S6 s6; | ||
// [email protected]:* {{'TypeDef::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found typedef 'b' with underlying type 'float'}} | ||
// [email protected]:* {{but in 'FirstModule' found typedef 'b' with different underlying type 'TypeDef::F' (aka 'float')}} | ||
#endif | ||
} // namespace TypeDef | ||
|
||
namespace Using { | ||
|
@@ -632,6 +683,57 @@ S3 s3; | |
// [email protected]:* {{'Using::S3::a' from module 'FirstModule' is not present in definition of 'Using::S3' in module 'SecondModule'}} | ||
// [email protected]:* {{declaration of 'a' does not match}} | ||
#endif | ||
|
||
#if defined(FIRST) | ||
struct S4 { | ||
using a = int; | ||
using b = int; | ||
}; | ||
#elif defined(SECOND) | ||
struct S4 { | ||
using b = int; | ||
using a = int; | ||
}; | ||
#else | ||
S4 s4; | ||
// [email protected]:* {{'Using::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found type alias name 'b'}} | ||
// [email protected]:* {{but in 'FirstModule' found type alias name 'a'}} | ||
#endif | ||
|
||
#if defined(FIRST) | ||
struct S5 { | ||
using a = int; | ||
using b = int; | ||
int x; | ||
}; | ||
#elif defined(SECOND) | ||
struct S5 { | ||
int x; | ||
using b = int; | ||
using a = int; | ||
}; | ||
#else | ||
S5 s5; | ||
// [email protected]:* {{'Using::S5' has different definitions in different modules; first difference is definition in module 'SecondModule' found field}} | ||
// [email protected]:* {{but in 'FirstModule' found type alias}} | ||
#endif | ||
|
||
#if defined(FIRST) | ||
typedef float F; | ||
struct S6 { | ||
using a = int; | ||
using b = F; | ||
}; | ||
#elif defined(SECOND) | ||
struct S6 { | ||
using a = int; | ||
using b = float; | ||
}; | ||
#else | ||
S6 s6; | ||
// [email protected]:* {{'Using::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found type alias 'b' with underlying type 'float'}} | ||
// [email protected]:* {{but in 'FirstModule' found type alias 'b' with different underlying type 'Using::F' (aka 'float')}} | ||
#endif | ||
} // namespace Using | ||
|
||
namespace RecordType { | ||
|