diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-02-10 23:36:10 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-02-10 23:36:10 +0000 |
commit | 6ae5e6649f5d01a1b593f4db755bfcb42e095700 (patch) | |
tree | 841c3c947cebf332886b34e55a0120c6d95f1789 /lib/Sema/SemaType.cpp | |
parent | 22ab8d86ec613ace6602b6de11fa9ccc08580f6b (diff) |
Add type-checking and implicit conversions for template parameters of
integral or enumeration type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index e898782f31..7049a301f7 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -835,3 +835,17 @@ bool Sema::DiagnoseIncompleteType(SourceLocation Loc, QualType T, unsigned diag, return true; } + +/// \brief Determine whether the given types are equivalent. +bool Sema::hasSameType(QualType T1, QualType T2) { + return Context.getCanonicalType(T1) == Context.getCanonicalType(T2); +} + +/// \brief Determine whether the given types are equivalent after +/// cvr-qualifiers have been removed. +bool Sema::hasSameUnqualifiedType(QualType T1, QualType T2) { + T1 = Context.getCanonicalType(T1); + T2 = Context.getCanonicalType(T2); + return T1.getUnqualifiedType() == T2.getUnqualifiedType(); +} + |