[cfe-commits] r106094 - /cfe/trunk/www/cxx_compatibility.html

John McCall rjmccall at apple.com
Wed Jun 16 01:48:08 PDT 2010


Author: rjmccall
Date: Wed Jun 16 03:48:08 2010
New Revision: 106094

URL: http://llvm.org/viewvc/llvm-project?rev=106094&view=rev
Log:
Some more nods to HTML well-formedness.


Modified:
    cfe/trunk/www/cxx_compatibility.html

Modified: cfe/trunk/www/cxx_compatibility.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_compatibility.html?rev=106094&r1=106093&r2=106094&view=diff
==============================================================================
--- cfe/trunk/www/cxx_compatibility.html (original)
+++ cfe/trunk/www/cxx_compatibility.html Wed Jun 16 03:48:08 2010
@@ -120,11 +120,11 @@
 <p>Some versions of GCC accept the following invalid code:
 
 <pre>
-#include <iostream>
-#include <utility>
+#include <iostream>
+#include <utility>
 
-template<typename T>
-void Dump(const T& value) {
+template<typename T>
+void Dump(const T& value) {
   std::cout << value << "\n";
 }
 
@@ -132,7 +132,7 @@
   struct Data {};
 }
 
-std::ostream& operator<<(std::ostream& out, ns::Data) {
+std::ostream& operator<<(std::ostream& out, ns::Data) {
   return out << "Some data";
 }
 
@@ -141,8 +141,8 @@
   Dump(ns::Data());
 }
 
-template<typename T, typename U>
-std::ostream& operator<<(std::ostream& out, const std::pair<T, U>& p) {
+template<typename T, typename U>
+std::ostream& operator<<(std::ostream& out, const std::pair<T, U>& p) {
   return out << '(' << p.first << ", " << p.second << ")";
 }
 </pre>
@@ -150,16 +150,16 @@
 <p>Clang complains:</p>
 
 <pre>
-<b>test.cc:6:13: <span class=error>error:</span> invalid operands to binary expression ('ostream' (aka 'basic_ostream<char>') and 'std::pair<int, double> const')</b>
+<b>test.cc:6:13: <span class=error>error:</span> invalid operands to binary expression ('ostream' (aka 'basic_ostream<char>') and 'std::pair<int, double> const')</b>
   std::cout << value << "\n";
   <span class=caret>~~~~~~~~~ ^  ~~~~~</span>
-<b>test.cc:18:3: note:</b> in instantiation of function template specialization 'Dump<std::pair<int, double> >' requested here
+<b>test.cc:18:3: note:</b> in instantiation of function template specialization 'Dump<std::pair<int, double> >' requested here
   Dump(std::make_pair(3, 4.5));
   <span class=caret>^</span>
-<b>test.cc:6:13: <span class=error>error:</span> invalid operands to binary expression ('ostream' (aka 'basic_ostream<char>') and 'ns::Data const')</b>
+<b>test.cc:6:13: <span class=error>error:</span> invalid operands to binary expression ('ostream' (aka 'basic_ostream<char>') and 'ns::Data const')</b>
   std::cout << value << "\n";
   <span class=caret>~~~~~~~~~ ^  ~~~~~</span>
-<b>test.cc:19:3: note:</b> in instantiation of function template specialization 'Dump<ns::Data>' requested here
+<b>test.cc:19:3: note:</b> in instantiation of function template specialization 'Dump<ns::Data>' requested here
   Dump(ns::Data());
   <span class=caret>^</span>
 2 errors generated.
@@ -168,8 +168,8 @@
 <p>The standard, in [temp.dep.candidate], says that unqualified names
 like <tt>operator<<</tt> are looked up when the template is
 defined, not when it's instantiated. Since
-<tt>operator<<(std::ostream&, const std::pair<>&)</tt>
-and <tt>operator<<(std::ostream&, ns::Data)</tt> were not
+<tt>operator<<(std::ostream&, const std::pair<>&)</tt>
+and <tt>operator<<(std::ostream&, ns::Data)</tt> were not
 declared yet when <tt>Dump</tt> was defined, they're not considered.
 
 <p>This is complicated by <i>argument-dependent lookup</i> (ADL),





More information about the cfe-commits mailing list