diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-12 01:05:20 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-12 01:05:20 +0000 |
commit | 193649c2a3ff0616777de934a2bf47eaeb4f1076 (patch) | |
tree | 2cc0066df2ba385d84949f4f8b0186fd5b561d0f /lib/Sema/SemaInit.cpp | |
parent | 013539cddae154cd1782984a7dc3bb471cac397e (diff) |
Only produce one -Wc++98-compat warning when initializing a reference from an init list with multiple elements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172285 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 111f81e449..94dd2aa45c 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -4877,6 +4877,7 @@ InitializationSequence::Perform(Sema &S, if (S.getLangOpts().CPlusPlus11 && Entity.getType()->isReferenceType() && Args.size() == 1 && isa<InitListExpr>(Args[0]) && + cast<InitListExpr>(Args[0])->getNumInits() == 1 && Entity.getKind() != InitializedEntity::EK_Parameter) { // Produce a C++98 compatibility warning if we are initializing a reference // from an initializer list. For parameters, we produce a better warning |