[PATCH] D82446: [clang] Fix duplicate warning
kamlesh kumar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 24 03:44:57 PDT 2020
kamleshbhalui created this revision.
kamleshbhalui added reviewers: rsmith, aaron.ballman.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Fixes duplicate warning emitted by clang when
char16_t/char32_t is used in the catch block.
Fixes this
https://bugs.llvm.org/show_bug.cgi?id=46425
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D82446
Files:
clang/lib/Parse/ParseExprCXX.cpp
clang/test/Parser/cxx98-char.cpp
Index: clang/test/Parser/cxx98-char.cpp
===================================================================
--- /dev/null
+++ clang/test/Parser/cxx98-char.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -std=c++11 -Wc++98-compat -verify=cxx11 -fcxx-exceptions %s
+void foo()
+{
+ try { }
+ catch (char16_t b) {} // cxx11-warning {{'char16_t' type specifier is incompatible with C++98}}
+ catch (char32_t c) {} // cxx11-warning {{'char32_t' type specifier is incompatible with C++98}}
+}
Index: clang/lib/Parse/ParseExprCXX.cpp
===================================================================
--- clang/lib/Parse/ParseExprCXX.cpp
+++ clang/lib/Parse/ParseExprCXX.cpp
@@ -2270,7 +2270,6 @@
///
bool Parser::ParseCXXTypeSpecifierSeq(DeclSpec &DS) {
ParseSpecifierQualifierList(DS, AS_none, DeclSpecContext::DSC_type_specifier);
- DS.Finish(Actions, Actions.getASTContext().getPrintingPolicy());
return false;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82446.272955.patch
Type: text/x-patch
Size: 928 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200624/6cd019dd/attachment.bin>
More information about the cfe-commits
mailing list