diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-07-11 19:58:23 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-07-11 19:58:23 +0000 |
commit | b13eb8dca5df6424abeedfdbfd1a96fbb7a97565 (patch) | |
tree | efb68eaf0148997978dad14c5b4ca83be180aac4 /clang/test/PCH/cxx11-constexpr.cpp | |
parent | 20dced4dbb44780dbdb4eb460b0717fa6a4f0ba3 (diff) | |
download | bcm5719-llvm-b13eb8dca5df6424abeedfdbfd1a96fbb7a97565.tar.gz bcm5719-llvm-b13eb8dca5df6424abeedfdbfd1a96fbb7a97565.zip |
Allow -verify directives to be filtered by preprocessing.
This is accomplished by making VerifyDiagnosticsConsumer a CommentHandler,
which then only reads the -verify directives that are actually in live
blocks of code. It also makes it simpler to handle -verify directives that
appear in header files, though we still have to manually reparse some files
depending on how they are generated.
This requires some test changes. In particular, all PCH tests now have their
-verify directives outside the "header" portion of the file, using the @line
syntax added in r159978. Other tests have been modified mostly to make it
clear what is being tested, and to prevent polluting the expected output with
the directives themselves.
Patch by Andy Gibbs! (with slight modifications)
The new Frontend/verify-* tests exercise the functionality of this commit,
as well as r159978, r159979, and r160053 (Andy's other -verify enhancements).
llvm-svn: 160068
Diffstat (limited to 'clang/test/PCH/cxx11-constexpr.cpp')
-rw-r--r-- | clang/test/PCH/cxx11-constexpr.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/test/PCH/cxx11-constexpr.cpp b/clang/test/PCH/cxx11-constexpr.cpp index 338543ecf93..ce43206d396 100644 --- a/clang/test/PCH/cxx11-constexpr.cpp +++ b/clang/test/PCH/cxx11-constexpr.cpp @@ -6,11 +6,11 @@ #define HEADER_INCLUDED struct B { - B(); // expected-note {{here}} + B(); constexpr B(char) {} }; -struct C { // expected-note {{not an aggregate and has no constexpr constructors}} +struct C { B b; double d = 0.0; }; @@ -24,6 +24,8 @@ struct D : B { static_assert(D(4).k == 9, ""); constexpr int f(C c) { return 0; } // expected-error {{not a literal type}} +// expected-note@13 {{not an aggregate and has no constexpr constructors}} constexpr B b; // expected-error {{constant expression}} expected-note {{non-constexpr}} + // expected-note@9 {{here}} #endif |