diff options
author | Hans Wennborg <hans@hanshq.net> | 2013-12-11 23:40:50 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2013-12-11 23:40:50 +0000 |
commit | cda4b6dd007c4726f36f4cd24271b49cc19f1f5a (patch) | |
tree | e6ce6c3b704e3032a58fac25b81be60e467c3d60 /clang/test/SemaCXX/operator-arrow-depth.cpp | |
parent | 6030c84a2fc1b6f84494807d27bc96d8f522b5c0 (diff) | |
download | bcm5719-llvm-cda4b6dd007c4726f36f4cd24271b49cc19f1f5a.tar.gz bcm5719-llvm-cda4b6dd007c4726f36f4cd24271b49cc19f1f5a.zip |
Change semantics of regex expectations in the diagnostic verifier
Previously, a line like
// expected-error-re {{foo}}
treats the entirety of foo as a regex. This is inconvenient when matching type
names containing regex characters. For example, to match
"void *(class test8::A::*)(void)" inside such a regex, one would have to type
"void \*\(class test8::A::\*\)\(void\)".
This patch changes the semantics of expected-error-re to only treat the parts
of the directive wrapped in double curly braces as regexes. This avoids the
escaping problem and leads to nicer patterns for those cases; see e.g. the
change to test/Sema/format-strings-scanf.c.
(The balanced search for closing }} of a directive also makes us handle the
full directive in test\SemaCXX\constexpr-printing.cpp:41 and :53.)
Differential Revision: http://llvm-reviews.chandlerc.com/D2388
llvm-svn: 197092
Diffstat (limited to 'clang/test/SemaCXX/operator-arrow-depth.cpp')
-rw-r--r-- | clang/test/SemaCXX/operator-arrow-depth.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/operator-arrow-depth.cpp b/clang/test/SemaCXX/operator-arrow-depth.cpp index 3e2ba8e4522..769dae0d246 100644 --- a/clang/test/SemaCXX/operator-arrow-depth.cpp +++ b/clang/test/SemaCXX/operator-arrow-depth.cpp @@ -9,7 +9,7 @@ template<int N> struct A { template<int N> struct B { A<N-1> operator->(); // expected-note +{{'operator->' declared here produces an object of type 'A<}} #if MAX != 2 - // expected-note-re@-2 {{(skipping (120|2) 'operator->'s in backtrace)}} + // expected-note-re@-2 {{(skipping {{120|2}} 'operator->'s in backtrace)}} #endif }; @@ -22,5 +22,5 @@ A<MAX/2> good; int n = good->n; B<MAX/2 + 1> bad; -int m = bad->n; // expected-error-re {{use of 'operator->' on type 'B<(2|10|128) / 2 \+ 1>' would invoke a sequence of more than (2|10|128) 'operator->' calls}} +int m = bad->n; // expected-error-re {{use of 'operator->' on type 'B<{{2|10|128}} / 2 + 1>' would invoke a sequence of more than {{2|10|128}} 'operator->' calls}} // expected-note@-1 {{use -foperator-arrow-depth=N to increase 'operator->' limit}} |