diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-26 06:47:28 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-26 06:47:28 +0000 |
commit | d85bea2affdd59d83d1be7d24b97f436484c3625 (patch) | |
tree | c54ffce5ad16d80e08ccbb6ebfd047206c93ac1a /include/clang/Basic | |
parent | 74e3c92aa3eb1750ac2eb89994046eb69db39100 (diff) |
Rework the Parse-Sema interaction for friends to better support friend
class templates. We now treat friend class templates much more like
normal class templates, except that they still get special name lookup
rules. Fixes PR5057 and eliminates a bunch of spurious diagnostics in
<iostream>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82848 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic')
-rw-r--r-- | include/clang/Basic/DiagnosticParseKinds.td | 4 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index c018497907..6971df50cb 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -279,6 +279,10 @@ def err_expected_type_name_after_typename : Error< def err_variadic_templates : Error< "variadic templates are only allowed in C++0x">; + +// C++ declarations +def err_friend_decl_defines_class : Error< + "cannot define a type in a friend declaration">; // Language specific pragmas // - Generic warnings diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 095b7ab387..44b582d43c 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -308,8 +308,6 @@ def err_static_assert_expression_is_not_constant : Error< "static_assert expression is not an integral constant expression">; def err_static_assert_failed : Error<"static_assert failed \"%0\"">; -def err_friend_decl_defines_class : Error< - "cannot define a type in a friend declaration">; def err_unexpected_friend : Error< "friends can only be classes or functions">; def err_friend_is_member : Error< @@ -317,8 +315,7 @@ def err_friend_is_member : Error< def ext_friend_inner_class : Extension< "C++ 98 does not allow inner classes as friends">; def err_unelaborated_friend_type : Error< - "must specify '%select{class|union}0' in a friend " - "%select{class|union}0 declaration">; + "must specify '%select{struct|union|class|enum}0' to befriend %1">; def err_qualified_friend_not_found : Error< "no function named %0 with type %1 was found in the specified scope">; def err_introducing_special_friend : Error< |