diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-01-09 23:46:59 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-01-09 23:46:59 +0000 |
commit | d18840d1e27c1b9c27bb74923b87f8ae33ec4736 (patch) | |
tree | f2ce80a27c44f82650f6945b89bca624c3758608 /lib/Sema/SemaDecl.cpp | |
parent | 1c94c16317c1a35c1549e022958188eea2567089 (diff) |
Don't crash with -Wlarge-by-value-copy and a dependent type. PR11726.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147812 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index b541e7d9e7..4a804bfcff 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -6777,7 +6777,7 @@ void Sema::DiagnoseSizeOfParametersAndReturnValue(ParmVarDecl * const *Param, // Warn if the return value is pass-by-value and larger than the specified // threshold. - if (ReturnTy.isPODType(Context)) { + if (!ReturnTy->isDependentType() && ReturnTy.isPODType(Context)) { unsigned Size = Context.getTypeSizeInChars(ReturnTy).getQuantity(); if (Size > LangOpts.NumLargeByValueCopy) Diag(D->getLocation(), diag::warn_return_value_size) @@ -6788,7 +6788,7 @@ void Sema::DiagnoseSizeOfParametersAndReturnValue(ParmVarDecl * const *Param, // threshold. for (; Param != ParamEnd; ++Param) { QualType T = (*Param)->getType(); - if (!T.isPODType(Context)) + if (T->isDependentType() || !T.isPODType(Context)) continue; unsigned Size = Context.getTypeSizeInChars(T).getQuantity(); if (Size > LangOpts.NumLargeByValueCopy) |