diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-21 21:42:57 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-21 21:42:57 +0000 |
commit | a8bebbeb2ba5f6d8a0d6859a7e5713a8970aad8e (patch) | |
tree | f32fc51a8e46bc39d8cce99b38d20e98c1c3e455 /lib/Sema/SemaInit.cpp | |
parent | b8618b7fcb2c73f5dbb43fffe35f78228c83235b (diff) | |
download | clang-a8bebbeb2ba5f6d8a0d6859a7e5713a8970aad8e.tar.gz |
Perform type-checking for a converted constant expression in a template
argument even if the expression is value-dependent (we need to suppress the
final portion of the narrowing check, but the rest of the checking can still be
done eagerly).
This affects template template argument validity and partial ordering under
p0522r0.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290276 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 5bb5518c58..8ab14b2a63 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -6816,7 +6816,7 @@ InitializationSequence::Perform(Sema &S, CurInit = CurInitExprRes; if (Step->Kind == SK_ConversionSequenceNoNarrowing && - S.getLangOpts().CPlusPlus && !CurInit.get()->isValueDependent()) + S.getLangOpts().CPlusPlus) DiagnoseNarrowingInInitList(S, *Step->ICS, SourceType, Entity.getType(), CurInit.get()); @@ -8070,6 +8070,7 @@ static void DiagnoseNarrowingInInitList(Sema &S, switch (SCS->getNarrowingKind(S.Context, PostInit, ConstantValue, ConstantType)) { case NK_Not_Narrowing: + case NK_Dependent_Narrowing: // No narrowing occurred. return; |