diff options
| author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-08-14 17:17:18 +0000 |
|---|---|---|
| committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-08-14 17:17:18 +0000 |
| commit | b261088a618d17ba71d8982093c8767da0e0e67a (patch) | |
| tree | 1fbcef7d243850b7e9d0851c788e6ceb7b424bce /clang/test/Sema/warn-documentation.cpp | |
| parent | 378b292aab4c80f2926dd0ed331ba15b8a0875d3 (diff) | |
| download | bcm5719-llvm-b261088a618d17ba71d8982093c8767da0e0e67a.tar.gz bcm5719-llvm-b261088a618d17ba71d8982093c8767da0e0e67a.zip | |
Attaching comments to redeclarations: fix wrong assumptions
The reason for the recent fallout for "attaching comments to any redeclaration"
change are two false assumptions:
(1) a RawComment is attached to a single decl (not true for 'typedef struct X *Y'
where we want the comment to be attached to both X and Y);
(2) the whole redeclaration chain has only a single comment (obviously false, the
user can put a separate comment for each redeclaration).
To fix (1) I revert the part of the recent change where a 'Decl*' member was
introduced to RawComment. Now ASTContext has a separate DenseMap for mapping
'Decl*' to 'FullComment*'.
To fix (2) I just removed the test with this assumption. We might not parse
every comment in redecl chain if we already parsed at least one.
llvm-svn: 161878
Diffstat (limited to 'clang/test/Sema/warn-documentation.cpp')
| -rw-r--r-- | clang/test/Sema/warn-documentation.cpp | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/clang/test/Sema/warn-documentation.cpp b/clang/test/Sema/warn-documentation.cpp index 16ba4297cdc..a361d57baa7 100644 --- a/clang/test/Sema/warn-documentation.cpp +++ b/clang/test/Sema/warn-documentation.cpp @@ -624,13 +624,9 @@ class test_attach37 { /// \brief\author Aaa /// \tparam T Aaa void test_attach38(int aaa, int bbb); -}; -// expected-warning@+1 {{empty paragraph passed to '\brief' command}} -/// \brief\author Aaa -/// \tparam T Aaa -template<typename T> -void test_attach37<T>::test_attach38(int aaa, int bbb) {} + void test_attach39(int aaa, int bbb); +}; // expected-warning@+2 {{empty paragraph passed to '\brief' command}} // expected-warning@+2 {{template parameter 'T' not found in the template declaration}} @@ -639,6 +635,13 @@ void test_attach37<T>::test_attach38(int aaa, int bbb) {} template<> void test_attach37<int>::test_attach38(int aaa, int bbb) {} +// expected-warning@+1 {{empty paragraph passed to '\brief' command}} +/// \brief\author Aaa +/// \tparam T Aaa +template<typename T> +void test_attach37<T>::test_attach39(int aaa, int bbb) {} + + // PR13411, reduced. We used to crash on this. /** @@ -652,7 +655,7 @@ void test_nocrash1(int); /// \param\brief void test_nocrash2(int); -// PR13593 +// PR13593, example 1 and 2 /** * Bla. @@ -668,3 +671,30 @@ template <typename> void test_nocrash3() { } + +// PR13593, example 3 + +/** + * aaa + */ +template <typename T> +inline T test_nocrash5(T a1) +{ + return a1; +} + +/// +//, + +inline void test_nocrash6() +{ + test_nocrash5(1); +} + +// We used to crash on this. + +/*! + Blah. +*/ +typedef const struct test_nocrash7 * test_nocrash8; + |

